notifyicon contextmenu in Wpf
-
Thursday, March 01, 2012 5:37 AM
I have a contextmenu,for notifyicon for wpf window in wpf as Open and Exit menuitems.
i have a problem that when i click on nitifyicon its working fine that is showing contextmenu and performing related operations. but when menu is opened and if i click anywhere except that menu items the opened menu is not closing. it will close if i click any where in monitor. please help me.
i wrote code like
System.Windows.Controls.Contextmenu menu=(System.Windows.Controls.Contextmenu)this.findresource("menuname");
menu.isopen=true;
help me.
All Replies
-
Monday, March 05, 2012 7:54 AMModerator
Hi aa11bb22cc33,
There is a StaysOpenOnClick property of MenuItem. Try set it. More info on this property, see:
http://msdn.microsoft.com/en-us/library/system.windows.controls.menuitem.staysopenonclick.aspx
Have a nice day,
Kee Poppy [MSFT]
MSDN Community Support | Feedback to us
- Marked As Answer by Kee PoppyModerator Tuesday, March 20, 2012 8:49 AM

