473,395 Members | 1,658 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

C# Context menu for system tray icon events not firing

30
I have a system tray icon with a context menu set to appear on right-click. On a right click the menu appears fine and I can select an option. The problem is that the event doesn't fire immediately. If I then go to right click again on the icon, the event fires at that time(instead of the context menu apprearing again).

Now I have options on my menu, and both have this problem. The first option actually just calls the icon's double-click event as it's event handler. Well if I double-click the icon, the event fires immediately.

has anyone had an issue like this before?
Sep 12 '07 #1
4 5276
Plater
7,872 Expert 4TB
You really shouldn't call events from withen events.
Make a function that gets called by either of the eventhandlers
Sep 12 '07 #2
ewokspy
30
You really shouldn't call events from withen events.
Make a function that gets called by either of the eventhandlers
Thank you for the advice, but that doesn't help regarding the problem I had.

Plus I am not calling events within events, as I set the event handler for the context menu as the event handler for the double-click. The click event for the context menu isn't even in the code.
Sep 17 '07 #3
Plater
7,872 Expert 4TB
So you made a systray icon and assigned it a context-menu.
If you assign anything to the mouseclick event of your systray icon, you should make sure it "ignores" the right-click so that your context-menu will show up.

I'm not sure what trouble you're actually having as I've always been able to do this just fine?
Sep 17 '07 #4
ewokspy
30
So you made a systray icon and assigned it a context-menu.
If you assign anything to the mouseclick event of your systray icon, you should make sure it "ignores" the right-click so that your context-menu will show up.

I'm not sure what trouble you're actually having as I've always been able to do this just fine?
that's just the thing. I can't imagine what it is that could interfere with the event firing. Now this is a multi-threaded program, but I don't think that is the interference since the double-click event of the sys icon fires just fine. It's the click function of the sys icon's context menu that seems to lag behind. In order to get it to fire I have to right click (the menu pops up), select the option on the menu I want, and then right-click a second time, at which point the context menu doesn't appear again, but the original option I chose fires it's event.
Sep 18 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: Lalit | last post by:
Hi Friends, I have developed a Windows service. Now i need icon for this service in systray and context menu fo this icon. Can i do this? With regards, Lalit
0
by: James | last post by:
Is there a way to Owner drawn tray context menu ? - I know that there is a bug with the custom drawing of a context menu assigned to a tray icon - but I was hoping someone could advise me as to how...
3
by: PJ Olson | last post by:
I have a context menu associated with a tray icon. On the context menu, I have a menuitem that is populated with sub menuitems at run time. When the user right-clicks the tray icon I populate the...
2
by: John Savidge | last post by:
I have the following code in a class in my simple forms application, its in the early stages. I am a VB.net newbie and have a question I am hoping someone could help me on. Assuming I know how...
2
by: PJSimon | last post by:
I have a system tray icon for my application. Each time the user pastes some text into the application, I add a submenu item in the system tray's context menu. The first time I right-click the icon...
0
by: Neo | last post by:
I have created a Windows Service that shows a notifyicon in the system tray. I have also created a context menu for the notifyicon and implemented the notifyicons click event. The notifyicon...
0
by: Mike Eaton | last post by:
Hi there, I have an app whose structure is as follows: a module calls a custom application context containing a notify icon and associated context menu, which in turn acts upon an instance of...
0
by: ld | last post by:
Hi, I have a Windows service that creates a tray icon. the tray icon gets created no problem however I cannot get any of the events on this icon to be fired in the Service. So if you double click...
1
by: Preeti | last post by:
Hi all I am a fresher and have been given a requirement in VB.net I have to make an application in VB.net which will run as a system tray icon and will add one or two items in the default...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.