[求助!] 托盘图标!

Teose 2004-12-10 12:29:05
有两个.net问题想请教一下大家:
(1)怎么在.net中使窗体如QQ中的好友列表一样只要挨到边就可以自动收缩
(2)怎么做出托盘图标

问题可能比较幼稚,不过对于我这个新手来说确是很难了,所以希望你能帮一下

谢谢!

...全文
134 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
xingfustar 2005-01-21
  • 打赏
  • 举报
回复
回答问题(2)
工具箱的notifyIcon控件

private void Form1_SizeChanged(object sender, System.EventArgs e)
{
if(this.WindowState==System.Windows.Forms.FormWindowState.Minimized)
{
this.Hide(); //窗体隐藏
this.notifyIcon1.Visible=true; //窗体显示时,托盘图标可见


}
}

private void notifyIcon1_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e)
{
this.Show();
this.WindowState=FormWindowState.Normal;
this.Activate();
}

private void notifyIcon1_Click(object sender, System.EventArgs e)
{
this.Visible=true;
this.WindowState=System.Windows.Forms.FormWindowState.Normal;
this.notifyIcon1.Visible=false; //窗体显示时,托盘图标不可见
}
steventone 2004-12-10
  • 打赏
  • 举报
回复
http://dotnet.aspx.cc/ShowDetail.aspx?id=AD98CE17-7F43-4C97-8FE5-836B6C743EDA

110,534

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧