登录
首页 » C#源码 » 用C#实现启动欢迎画面

用C#实现启动欢迎画面

于 2022-01-22 发布 文件大小:64.17 kB
0 74
下载积分: 2 下载次数: 1

代码说明:

用C#制作软件启动时的欢迎界面,开始画面,在软件被打开时最先显示的一个窗口效果,在本例中是直接调用一张图片来显示,但是具体的实现,比如图片显示的位置 、显示的时间长短等,用到的定时器,需要控制好,本实例代码就是向大家展示如何进行这些控制,部分代码为:   private void Form1_Load(object sender, EventArgs e)   {//启动窗体    Form2 MySplashForm = new Form2();    MySplashForm.ShowDialog();   }   private void Form2_Load(object sender, EventArgs e)   {//设置启动窗体    this.FormBorderStyle = FormBorderStyle.None;    this.BackgroundImage = Image.FromFile("test.jpg");    this.timer1.Start();    this.timer1.Interval = 10000;   }      private void timer1_Tick(object sender, EventArgs e)   {//关闭启动窗体    this.Close();   }   定时器控制:   private void Form2_FormClosed(object sender, FormClosedEventArgs e)   {//关闭定时器    this.timer1.Stop();   }

下载说明:请别用迅雷下载,失败请重下,重下不扣分!

发表评论

0 个回复

  • C#操作数据库显示Customers数据表第3-7条记录
    显示Customers数据表第3-7条记录,C#操作数据库显示Customers数据表第3-7条记录,其实做出来例子,才知道,很简单啊,不过需要把数据库先连接好,看如下代码:   private void button1_Click(object sender, EventArgs e)    {//显示Customers数据表第3-7条记录    SqlConnection MyConnection=new SqlConnection();    MyConnection.ConnectionString = @"Data Source =.SQLEXPRESS;Initial Catalog=Northwind;Integrated Security=True";    MyConnection.Open();    SqlCommand MyCommand =new SqlCommand("Select * From Customers ORDER BY CustomerID", MyConnection);    DataSet MySet = new DataSet();    SqlDataAdapter MyAdapter = new SqlDataAdapter(MyCommand);    MyAdapter.Fill(MySet, 2, 5, "Customers");    this.dataGridView1.DataSource=MySet.Tables["Customers"];   }
    2022-03-03 23:39:45下载
    积分:1
  • C# 设置应用程序背景颜色
    C# 设置应用程序背景颜色,通过调用Windows调色板,来选取颜色,然后程序将颜色值赋值给窗口,此盒子可设置斜体的颜色值,运行效果如参考截图所示,核心代码请看以下代码片段:   private void Form1_Load(object sender, EventArgs e)   {//显示应用程序背景颜色    //先打开“Properties”,添加一个System.Drawing.Color类型的变量MyBackColor    this.BackColor = Properties.Settings.Default.MyBackColor;   }   private void button1_Click(object sender, EventArgs e)   {//设置应用程序背景颜色(在运行时编写用户设置)    if(this.colorDialog1.ShowDialog()==DialogResult.OK)    {    Properties.Settings.Default.MyBackColor = this.colorDialog1.Color;    Properties.Settings.Default.Save();    this.BackColor = Properties.Settings.Default.MyBackColor;    }   }
    2022-06-22 05:36:16下载
    积分:1
  • C# 在LINQ to DataSet中对分组操作执行子查询
    C# 在LINQ to DataSet中对分组操作执行子查询,相关代码:   private void button1_Click(object sender, EventArgs e)   {//在LINQ to DataSet中对分组操作执行子查询    SqlConnection MyConnection = new SqlConnection();    MyConnection.ConnectionString = @"Data Source =.SQLEXPRESS;Initial Catalog=Northwind;Integrated Security=True";    MyConnection.Open();    SqlCommand MyCommand = new SqlCommand("Select * From Orders ", MyConnection);    DataSet MySet = new DataSet();    SqlDataAdapter MyAdapter = new SqlDataAdapter(MyCommand);    MyAdapter.Fill(MySet);    DataTable MyQueryTable = MySet.Tables[0];    var MyQuery = from MyOrder in MyQueryTable.AsEnumerable()    orderby MyOrder.Field("ShipCity")    group MyOrder by MyOrder.Field("ShipCity") into g    select new    {    MyCity = g.Key,    MyMaxFreight = (from MyData in g select MyData.Field("Freight")).Max()   
    2022-01-27 20:20:32下载
    积分:1
  • 一套能用的C#小型餐厅餐饮管理系统 附和数据库
    这是一款采用C#和SQLSERVER开发的小型餐厅餐饮管理系统 附源码和数据库,通过这个系统你可以对中小型餐厅消费进行管理,可实现对餐厅顾客开台、点菜/加菜、账目查询和结账等操作。   可自动检验输入数据,可实现消费账目自动结算以及消费历史记录查询,并且支持数据库端的模糊查询。   如果要使用本款系统,可使用Tsoft,密码为:111进行登录测试。   登录后分为三种操作权限:超级管理员、经理、一般用户,权限不同,所对应的操作也不尽相同哦。   关于本C#餐饮系统的使用:   单击鼠标右键,可进行开台、取消开台、点菜、消费查询及结账操作。锁定系统解锁密码为:111。如果添加菜品类别,需要在数据库中添加。
    2022-08-06 19:31:14下载
    积分:1
  • C#制作文字渐变的 WPF 窗体按钮特效
    C#制作文字渐变的 WPF 窗体按钮特效,就是大家熟悉的渐变按钮,按钮的大小会随窗口的变化而变化,且按钮中的文本颜色呈现渐变色彩,当鼠标悬停于上面时,还会具有不同的渐变动画效果,截图所示为静态效果,请下载后编译查看动画效果.
    2022-01-26 00:26:26下载
    积分:1
  • C#在listView自定义imageList图标列表
    C#在listView自定义imageList图标列表,实际上是创建了一个图像列表的Listview列表,我们可以将一些菜单条目做成此类型,以图标的风格展现操作选项,本实例中你可以熟悉imageList、listView1列表项的添加与删除。   下面是关键的代码:   listView1.LargeImageList = imageList1;   imageList1.ImageSize = new Size(37,36);   imageList1.Images.Add(Image.FromFile("01.png"));调用图标显示的图像资源   imageList1.Images.Add(Image.FromFile("02.png"));   listView1.SmallImageList = imageList1;   listView1.Items.Add("明日科技");图标下边显示的文字   listView1.Items.Add("C#编程词典");   listView1.Items[0].ImageIndex = 0;   listView1.Items[1].ImageIndex = 1;
    2023-03-09 08:05:03下载
    积分:1
  • C#结合数据库生成饼形图表
    C#结合数据库生成饼形图表,这种图表是常见的数据统计图表,饼形图、柱状图等使用十分广泛,本程序演示了C#从数据库中读取出数据,然后交给饼形图生成模块,加载数据生成饼形图表。   //清空背景色   g.Clear(Color.White);   Pen pen1 = new Pen(Color.Red);   Brush brush1 = new SolidBrush(Color.PowderBlue);   Brush brush2 = new SolidBrush(Color.Blue);   Brush brush3 = new SolidBrush(Color.Wheat);   Brush brush4 = new SolidBrush(Color.Orange);   Font font1 = new Font("Courier New", 16, FontStyle.Bold);   Font font2 = new Font("Courier New", 8);   g.FillRectangle(brush1, 0, 0, width, height); //绘制背景图   g.DrawString("公司员工年龄比例饼形图", font1, brush2, new Point(80, 20)); //书写标题   int piex = 100, piey = 60, piew = 200, pieh = 200;   //20-25岁员工在圆中分配的角度   float angle1 = Convert.ToSingle((360 / Convert.ToSingle(Sum)) * Convert.ToSingle(man20to25));   //26-30岁员工在圆中分配的角度   float angle2 = Convert.ToSingle((360 / Convert.ToSingle(Sum)) * Convert.ToSingle(man26to30));   //31-40岁员工在圆中分配的角度   float angle3 = Convert.ToSingle((360 / Convert.ToSingle(Sum)) * Convert.ToSingle(man31to40));   g.FillPie(brush2
    2022-04-12 00:35:45下载
    积分:1
  • C# 图像控件显示绘制的几何图形
    C# 使用图像控件显示绘制的多个几何图形,可一次显示多个绘制的图形,相关代码如下:   GeometryGroup MyGeometry = new GeometryGroup();   MyGeometry.Children.Add(new EllipseGeometry(new Point(50, 50), 45, 20));   MyGeometry.Children.Add(new EllipseGeometry(new Point(50, 50), 20, 45));   RectangleGeometry MyRectangle = new RectangleGeometry();   MyRectangle.Rect = new Rect(2, 2, 96, 96);   MyGeometry.Children.Add(MyRectangle);   GeometryDrawing MyDrawing = new GeometryDrawing();   MyDrawing.Geometry = MyGeometry;   MyDrawing.Pen = new Pen(Brushes.Blue, 3);   DrawingImage MyImage = new DrawingImage();   MyImage.Drawing = MyDrawing;   MyImage.Freeze();   this.image1.Source = MyImage;
    2022-03-07 01:28:50下载
    积分:1
  • C# 为textBox文本框控件添加颜色光环
    C# 为文本框控件添加颜色光环,是不是把textBox装扮得很漂亮呢?外发光的文本框,有点沙沙的感觉,核心代码有兴趣可参考:   private void Window_Loaded(object sender, RoutedEventArgs e)   {//为文本框控件添加颜色光环    var MyOuterGlowBitmapEffect = new System.Windows.Media.Effects.OuterGlowBitmapEffect();    MyOuterGlowBitmapEffect.GlowSize = 30;    Color MyColor = new Color();    MyColor.ScA = 1;    MyColor.ScB = 1;    MyColor.ScG = 0;    MyColor.ScR = 0;    MyOuterGlowBitmapEffect.GlowColor = MyColor;    MyOuterGlowBitmapEffect.Noise = 1;    MyOuterGlowBitmapEffect.Opacity =0.8;    this.textBox1.BitmapEffect = MyOuterGlowBitmapEffect;   }   完整的C#可编译源代码,请下载本源码。
    2022-07-09 20:47:57下载
    积分:1
  • C#检查CheckBox控件是否被选中
    C#检查CheckBox复选框控件是否被选中,或者说是判断用户是否单击了checkbox按钮,可用于用户输入界面中,本示例提供了完整的复选框判断机制,有需要的可参考以下代码:   private void checkBox1_Click(object sender, EventArgs e)   {    if (checkBox1.CheckState == CheckState.Checked)    {    MessageBox.Show("CheckBox控件被选中");    }    else    {    MessageBox.Show("CheckBox控件选择被取消");    }   }
    2022-09-15 05:45:03下载
    积分:1
  • 696522资源总数
  • 104047会员总数
  • 21今日下载