我想要QQ那样的只有一个图标,点击就可以打开还有右击菜单,怎么实现啊,望前辈指点!
解决方案 »
- 如何去掉websphere的ssl,不用https访问websphere??急!!急
- C#2008下的DataGirdView控件如何将某个单元格设置成ComboBox呀!?
- 在线等 TextBox 问题
- DataBinding:“System.Data.DataRowView”不包含名为“BookClassName”的属性。
- 打包的时候怎么设置,可以使安装好的程序出现在桌面
- 打印问题
- 为控件设置输入焦点有什么用?
- 什么是装箱、拆箱?书上写的有点看糊涂了,请指教,谢谢.
- 使用了SqlHelper,如何让它回滚?如何取回返回值?
- 检测一个字符串是否存在,用什么技术比较好?
- 数据库的问题
- WPF & Expression Encoder 相关
給你一個小列子Private Sub NotifyIcon1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles NotifyIcon1.Click
If WindowState = FormWindowState.Minimized Then
WindowState = FormWindowState.Maximized
Activate()
NotifyIcon1.Visible = False
ShowInTaskbar = True
End If
End Sub Private Sub MDIMain_SizeChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.SizeChanged
If WindowState = FormWindowState.Minimized Then
ShowInTaskbar = False
NotifyIcon1.Visible = True
End If
End Sub
{
if(this.WindowState==FormWindowState.Minimized)
{
this.Hide();
this.notifyIcon1.Visible=true;
}
} private void notifyIcon1_Click(object sender, EventArgs e)
{
this.Visible = true;
this.WindowState = FormWindowState.Normal;
this.notifyIcon1.Visible = false;
}
{
if (this.WindowState==FormWindowState.Minimized)
{
this.Hide();
this.notifyIcon1.Visible=true;
}}
4.添加点击图标事件(首先需要添加事件引用):