473,396 Members | 1,923 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,396 software developers and data experts.

Strange Context Menu Behavior Please help

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 sub menuitems with the
following code:

Private Sub cmTray_Popup(ByVal sender As Object, ByVal e As
System.EventArgs) Handles cmTray.Popup

miPresets.MenuItems.Clear()

Dim rb As New Windows.Forms.RadioButton

Dim mip As New MenuItem

For Each rb In gbPresets.Controls

If rb.Tag <> "" Then

mip.MenuItems.Add(rb.Text & " - " & rb.Tag, AddressOf mi_Click)

End If

Next

miPresets.MergeType = MenuMerge.Add

miPresets.MergeMenu(mip)

miPresets.Text = "Presets"

End Sub

This code works the first two times the context menu is popped up. After
that, the sub-menu items never appear again.

Can anyone help with this?

Thanks,
PJ

Nov 20 '05 #1
3 1713
"PJ Olson" <go****@no.com> scripsit:
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 sub menuitems with the
following code: [...] This code works the first two times the context menu is popped up. After
that, the sub-menu items never appear again.


Does the code get executed a 2nd time? Add breakpoints and watch the variables.

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>
Nov 20 '05 #2
No, each time I right-click on the tray icon the code is executed once.

PJ
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:bl************@ID-208219.news.uni-berlin.de...
"PJ Olson" <go****@no.com> scripsit:
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 sub menuitems with the
following code: [...]
This code works the first two times the context menu is popped up. After
that, the sub-menu items never appear again.


Does the code get executed a 2nd time? Add breakpoints and watch the

variables.
--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>

Nov 20 '05 #3
No, each time I right-click on the tray icon the code is executed once.

PJ
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:bl************@ID-208219.news.uni-berlin.de...
"PJ Olson" <go****@no.com> scripsit:
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 sub menuitems with the
following code: [...]
This code works the first two times the context menu is popped up. After
that, the sub-menu items never appear again.


Does the code get executed a 2nd time? Add breakpoints and watch the

variables.
--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>

Nov 20 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: thulsey | last post by:
Hi all, I've got some strange behavior happening in Firefox and Safari (Khtml and Gecko) that displays *almost* fine in IE6.0 (still trying to get pixels to line up, anal anal anal...) To...
4
by: Mohit Gupta | last post by:
Hi all, Lately I have been working on an application in VB .net CF for Pocket PC device. I have a small question about Context Menu. When I try to close the window after context menu is poped...
5
by: yxq | last post by:
Hi I am build vb6 Context menu extension, but how to determine which popup menu item(popupItem1 and popupItem2) was clicked? Thanks The code ' ' IContextMenu::QueryContextMenu '
2
by: Daniel | last post by:
Hello Everyone, I am using VS 2002 (VB.NET) and have a MDI application in which the user will open several child windows at the same time. I have included a menu Window, which MDIList property...
6
by: Joseph Geretz | last post by:
Writing an Outlook AddIn with C#. For the user interface within Outlook I'm adding matching pairs of Toolbar buttons and Menu items. All of the buttons and menu items are wired up to send events to...
4
by: Fred | last post by:
Hi, I have a list box with a context menu. When I right click the menu appears as expected. However when I select an option on the context menu the menu does not close. The click event on the...
3
by: coltrane | last post by:
Can someone direct me to a reference that describes how to create a context menu for a selected row in a datagrid? I have come across many threads regarding context menus and datagrids but they all...
2
by: travelrats | last post by:
Hi Here's my problem - I've been trying to figure this out for a while and ran out of ideas... <div> id1 contains <div> id2 (a geographical map) <div> id2 contains a context menu made out of...
3
by: Gary | last post by:
Hi all, I am writing an application which will intake arguments of filenames for processing: e.g. MyApp.exe "C:\abc.txt" "C:\def.doc" - then, MyApp will process the 2 files by parsing the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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...

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.