日期:2014-05-18  浏览次数:20944 次

如何才能实现像QQ那样的提示框呢???
如何才能实现像QQ那样的提示框呢,比如有什么重大新闻你右下角的QQ图标上就会自动弹出新闻的标题那样??

------解决方案--------------------
1. 将此窗体的 StartPosition 设置成 手动.
2. Form_Load 事件
this.Left = Screen.PrimaryScreen.Bounds.Width - this.Width;
this.Top = Screen.PrimaryScreen.WorkingArea.Height - this.Height;
------解决方案--------------------
实现托盘的闪烁功能(如QQ有消息时的闪烁)
(1).首先我们在空白窗体中拖入一个NotifyIcon控件和定时控件
private System.Windows.Forms.NotifyIcon notifyIcon1;
private System.Windows.Forms.Timer timer1;
(2).其次,我们准备两张ico图片,用来显示在任务栏,其中一张可用透明的ico图片,分别叫做1.ico和2.ico;并且建立两个icon对象分别用来存放两个ico图片;
private Icon ico1 = new Icon("1.ico");
private Icon ico2 = new Icon("2.ICO");//透明的图标
(3).在Form_load中初始化notifyicon:
private void Form1_Load(object sender, System.EventArgs e)
{
this.notifyIcon1.Icon=ico1;//设置程序刚运行时显示在任务栏的图标
this.timer1.Enable = true;//将定时控件设为启用,默认为false;
}
(4).先设置一个全局变量 i ,用来控制图片索引,然后创建定时事件,双击定时控件就可以编辑
int i=0;
private void timer1_Tick(object sender, System.EventArgs e)
{
//如果i=0则让任务栏图标变为透明的图标并且退出
if(i<1)
{
this.notifyIcon1.Icon=ico2;
i++;
return;
}
//如果i!=0,就让任务栏图标变为ico1,并将i置为0;
else
this.notifyIcon1.Icon=ico1;
i=0;
}

摘自http://qzone.qq.com/blog/30497105-1232636977