本文整理汇总了C#中System.Windows.Forms.ContextMenuStrip.Hide方法的典型用法代码示例。如果您正苦于以下问题:C# System.Windows.Forms.ContextMenuStrip.Hide方法的具体用法?C# System.Windows.Forms.ContextMenuStrip.Hide怎么用?C# System.Windows.Forms.ContextMenuStrip.Hide使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Forms.ContextMenuStrip
的用法示例。
在下文中一共展示了System.Windows.Forms.ContextMenuStrip.Hide方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: MainWindow
public MainWindow()
{
InitializeComponent();
notifier = new System.Windows.Forms.NotifyIcon();
this.contextMenu1 = new System.Windows.Forms.ContextMenuStrip();
refreshItem = new System.Windows.Forms.ToolStripMenuItem("Refresh");
correctItem = new System.Windows.Forms.ToolStripMenuItem("Correct Position");
currentPositionItem = new System.Windows.Forms.ToolStripMenuItem("Current Position");
exitItem = new System.Windows.Forms.ToolStripMenuItem("Exit");
this.contextMenu1.Items.AddRange(new System.Windows.Forms.ToolStripMenuItem[] { refreshItem, correctItem, currentPositionItem, exitItem });
refreshItem.Click += new System.EventHandler(this.refreshItem_Click);
correctItem.Click += new System.EventHandler(this.correcPositiontItem_Click);
exitItem.Click += new System.EventHandler(this.exitItem_Click);
notifier.Icon = MaraudersMap.Properties.Resources.TaskbarIconHigh;
notifier.Visible = true;
notifier.Click += new EventHandler(notifyIcon1_Click);
contextMenu1.LostFocus += (object sender, EventArgs a) => { contextMenu1.Hide(); };
refreshTimer = new Timer(checkPosition, null, TimeSpan.Zero, TimeSpan.FromMinutes(1));
InitializeWireless();
}