C#Windows 窗体设计-实现欢迎界面-显示About窗体-在托盘中写入应用程序图标
2014-10-15 09:03
751 查看
一、实现欢迎界面
1.
2.
3.
效果加载主窗体前会显示三秒中的欢迎界面。
二、显示About窗体
在C#中,可以通过”添加新项“给项目添加一个”关于框“,即About 窗体。点击主界面的关于按钮,弹出About窗体。
按钮时间响应:
三、在托盘中写入应用程序图标
需要使用NotifyIcon控件
代码如下:
1.
private void Form1_Load(object sender, EventArgs e) { //MessageBox.Show("将窗体加载到内存","信息",MessageBoxButtons.OK,MessageBoxIcon.Information); label1.Text = System.DateTime.Now.ToShortDateString(); label2.Text = System.DateTime.Now.ToLongDateString(); //timer2.Start(); Welcome wel = new Welcome(); wel.ShowDialog(); }
2.
3.
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; namespace Fenhang { public partial class Welcome : Form { public Welcome() { InitializeComponent(); } private void Welcome_Load(object sender, EventArgs e) { this.FormBorderStyle = FormBorderStyle.None; //this.BackgroundImage = Image.FromFile("image/1.jpg"); timer1.Start(); //this.timer1.Interval = 300000; } private void timer1_Tick(object sender, EventArgs e) { this.Close(); } private void Welcome_FormClosed(object sender, FormClosedEventArgs e) { this.timer1.Stop(); } } }
效果加载主窗体前会显示三秒中的欢迎界面。
二、显示About窗体
在C#中,可以通过”添加新项“给项目添加一个”关于框“,即About 窗体。点击主界面的关于按钮,弹出About窗体。
按钮时间响应:
private void button2_Click(object sender, EventArgs e) { AboutBox1 ab1 = new AboutBox1(); //this.Hide(); ab1.Show(); }
三、在托盘中写入应用程序图标
需要使用NotifyIcon控件
代码如下:
private void notifyIcon1_MouseDoubleClick_1(object sender, MouseEventArgs e) { if (this.WindowState == FormWindowState.Minimized) { this.WindowState = FormWindowState.Normal; this.Activate(); } } private void 退出ToolStripMenuItem_Click(object sender, EventArgs e) { this.Close(); }
相关文章推荐
- C#之使用NotifyIcon实现任务栏托盘菜单,图标闪烁效果及气泡提示 很多程序是只需要后台运行的,甚至不需要自己的应用界面。NotifyIcon提供了程序在任务栏的显示功能 程序下载链接如下
- C#--,设计一个windows应用程序,实现不同运算。
- C#实现WinForm程序的动态系统托图标 关闭主窗体时最小化到系统托盘
- C#Windows窗体界面设计_攻击决策项目_03_数据绘图_01_绘制坐标轴_修订ParamsForm
- C#Windows窗体界面设计_03_坐标系平移 旋转 镜像
- C#Windows窗体界面设计_攻击决策项目_02_设计窗体_03_设置窗体弹出退出顺序
- 在VS里创建Windows窗体,让其最小化在系统托盘,并显示一个Icon图标
- C#实现系统托盘,C#窗体最小化时隐藏为任务栏图标
- C#Windows窗体界面设计_01_绘制三角函数_五点作图法
- C#Windows窗体界面设计_攻击决策项目_02_设计窗体_01_主窗体
- C#Windows窗体界面设计_05_添加菜单栏 工具栏 状态栏 按钮
- 解决用C#写的窗体应用程序向数据库SQL Server表格中写入中文乱码显示???的方法
- VC++6.0中实现将应用程序的图标加入到Windows的系统托盘中 zz
- VC++6.0中实现将应用程序的图标加入到Windows的系统托盘中
- C#Windows窗体界面设计_01_绘制三角函数_五点作图法
- C#Windows窗体界面设计_06_通过调整坐标系来调整数据
- C#Windows窗体界面设计_攻击决策项目_01_系统架构
- wince应用程序(实现 获取存储设备的大小、实现 WINCE 系统重新启动、隐藏/显示 Windows 任务栏等等)【C#】
- C#实现系统托盘,C#窗体最小化时隐藏为任务栏图标
- C#Windows窗体界面设计_01_绘制三角函数_附强制类型转换