首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > C# >

notifyIcon 双击有关问题

2012-01-05 
notifyIcon 双击问题主窗体隐藏的时候,双击开启主窗体,已经开启的将其置在顶曾.和MSN的操作一样.privatevo

notifyIcon 双击问题
主窗体隐藏的时候,双击开启主窗体,已经开启的将其置在顶曾.和MSN的操作一样.

    private   void   notifyIcon1_DoubleClick(object   sender,   EventArgs   e)
                {
                        ShowMainForm(sender,   e);
                }
  private   void   ShowMainForm(object   sender,   System.EventArgs   e)
                {
                        this.Show();
                        this.Activate();                        
                }

左击和右击一样都显示标签.这个怎幺做


[解决办法]
private void notifyIcon1_Click(object sender, EventArgs e)
{
NotifyIcon nIcon = (NotifyIcon)sender;
nIcon.GetType().InvokeMember( "ShowContextMenu ",
BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.InvokeMethod, null, nIcon, null);
}

热点排行