Windows Develop Bookmark and Share   
 index > Windows Forms General > Button Click Event fired only for the second click
 

Button Click Event fired only for the second click

Hi,

My C# application is running in the System Tray. On right click over the icon displayed in the system tray, a menu is shown and on click of a menu item, the event should be fired. But in my case, the event is fired only for the second click. I.e., I right click on the icon and click the menu item. But still the event is not fired, so when I try to right-click again, the event gets fired, but for this time I need not click the menu item. Please help me to fix this problem.

Thanks in advance.

Arun G K  Friday, August 17, 2007 5:39 AM

I am not sure what might be going on. Some time ago I made a very simple sample to show how to create a icon in the system tray with a context menu. Try it and see if it behaves as you describe. If not you might get some ideas from the sample what your problem might be. If you are not able to find out what is going on you might want to post some more details and code what you do and how you do it.

The notifyicon sample

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=323097&SiteID=1

Andreas Johansson  Saturday, August 18, 2007 1:31 AM

I am not sure what might be going on. Some time ago I made a very simple sample to show how to create a icon in the system tray with a context menu. Try it and see if it behaves as you describe. If not you might get some ideas from the sample what your problem might be. If you are not able to find out what is going on you might want to post some more details and code what you do and how you do it.

The notifyicon sample

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=323097&SiteID=1

Andreas Johansson  Saturday, August 18, 2007 1:31 AM

You can use google to search for other answers

Custom Search

More Threads

• AccessViolationException with network printer
• How do I assign a form's icon from an imagelist image?
• Visual Studio 2005- help required linking data
• a simple question about hiding a form
• powerpoint automation
• \t doesn't work for the text of label
• Doubt about Event and Delegate in multithread context
• ChildForm...
• Is there anyone who knows why DataGridView of winform does not provide Paging Property different from GridView of webform?
• Flowlayoutpanel Controls Click Event