基本信息
源码名称:winform 缩小到托盘 实例
源码大小:1.16M
文件格式:.zip
开发语言:C#
更新时间:2013-06-24
友情提示:(无需注册或充值,赞助后即可获取资源下载链接)
嘿,亲!知识可是无价之宝呢,但咱这精心整理的资料也耗费了不少心血呀。小小地破费一下,绝对物超所值哦!如有下载和支付问题,请联系我们QQ(微信同号):813200300
本次赞助数额为: 2 元×
微信扫码支付:2 元
×
请留下您的邮箱,我们将在2小时内将文件发到您的邮箱
源码介绍
这是一个小的日志提示程序,一运行,就会出现首页,按alt f4隐藏首页,该图标会在显示在右下角托盘上。4当到一定的时间,就会自动运行别外一个页面,打开你的主页,主页上写上你的要做的事情就OK,我设定的是17:55:18分,大家可以根据需要,我加几个窗口,来提示某时做什么。 可以通过这个程序学会托盘程序的编写方法。
文件中有源文件和安装文件,安装前请先安装.netFramework运行环境。vs2008制作
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;
//download by http://www.codefans.net
namespace MyNote
{
public partial class mainFrame : Form
{
public mainFrame()
{
InitializeComponent();
}
private void mainFrame_Load(object sender, EventArgs e)
{
}
private void contextMenuLeft_Opening(object sender, CancelEventArgs e)
{
}
private void timer1_Tick(object sender, EventArgs e)
{
DateTime currentDate = new DateTime();
currentDate = System.DateTime.Now;
int hour = currentDate.Hour;
int minute = currentDate.Minute;
int second = currentDate.Second;
if (hour == 17 && minute == 55 && second == 18)
{
noteFrame nf = new noteFrame();
nf.Show();
nf.BringToFront();
nf.Activate();
}
}
private void TestBt_Click(object sender, EventArgs e)
{
}
private void 退出ToolStripMenuItem_Click(object sender, EventArgs e)
{
notifyIcon.Visible = false;
//应用程序结束
Application.Exit();
Application.ExitThread();
}
private void mainFrame_FormClosing(object sender, FormClosingEventArgs e)
{
e.Cancel = true; // 取消关闭窗体
this.Hide();//隐藏窗体
this.ShowInTaskbar = false;//设置本窗体不在Windows任务栏中显示
this.notifyIcon.Visible = true;//显示托盘图标
}
private void notifyIcon_MouseDoubleClick(object sender, MouseEventArgs e)
{
this.Show();//显示窗口
if (this.WindowState == FormWindowState.Minimized) //如果当前窗口为最小化
this.WindowState = FormWindowState.Normal; //设置窗口为正常模式
this.Activate(); //激活当前窗口
}
private void 帮助ToolStripMenuItem_Click(object sender, EventArgs e)
{
MessageBox.Show("该程序是一个小的日报序提示程序");
}
private void notifyIcon_MouseClick(object sender, MouseEventArgs e)
{
}
}
}