473,804 Members | 2,143 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Browsing Controls - ContextMenu issue

Hello
I am trying to browse a form and i know it has 3
contextmenus and a mainmenu.

Public Sub PercorreMenus(B yVal f As Form)
Dim ctl As Control
For Each ctl In f.Controls
If ctl.Controls.Co unt > 0 Then
PercorreMenus2( ctl, f)
End If
If TypeOf ctl Is ContextMenu Then
MessageBox.Show ("context")
Me.CheckMenuIte ms(DirectCast(c tl,
ContextMenu.Men uItemCollection ), f.Name)
End If
If TypeOf ctl Is MenuItem Then
MessageBox.Show ("menu")
Me.CheckMenuIte ms(DirectCast(c tl,
MenuItem.MenuIt emCollection), f.Name)
End If
Next

End Sub
Private Sub PercorreMenus2( ByVal controlo As Control,
ByVal f As Form)
Dim ctl As Control
Dim a As String
For Each ctl In controlo.Contro ls
If ctl.Controls.Co unt > 0 Then
PercorreMenus2( ctl, f)
End If
a = ctl.GetType.ToS tring
Console.WriteLi ne(a)
If TypeOf ctl Is ContextMenu Then
MessageBox.Show ("context")
Me.CheckMenuIte ms(DirectCast(c tl,
ContextMenu.Men uItemCollection ), f.Name)
End If
If TypeOf ctl Is MenuItem Then
MessageBox.Show ("menu")
Me.CheckMenuIte ms(DirectCast(c tl,
MenuItem.MenuIt emCollection), f.Name)
End If
Next
End Sub

I can browse form.mainmenu.m enuitems but not
form.contextmen u.menuitems...

Any suggestion would be most welcome, thanks!

Kind Regards
Jorge Cavalheiro
Nov 20 '05 #1
0 1022

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

Similar topics

1
1301
by: John Spiegel | last post by:
Hi All, Is it possible to build a ContextMenu object into a DLL then display that menu within a COM application? I'm having a problem with the ContextMenu expecting a Control object as a parameter, which I'm assuming the COM component can't be. I'm working on extending a VFP app that will be eventually replaced with a ..NET app. In the meantime, we're doing whatever new development we can in ..NET and exposing the functionality in...
2
2240
by: lukasz | last post by:
I call contextMenu.Show() in OnMouseDown handler the menu shows and then I press mouse button in other area to hide the menu (without selecting an option). Then I receive first OnMouseUp event, next OnMouseMove, which is very unwanted behavior in my case -- I would prefer to first know that the cursor has moved (and it has moved), only then the fact that a mouse button was pressed. Is there a solution for this? Note: I have not added the...
4
1551
by: Nikolay Petrov | last post by:
Hi everyone! I am developing app, which should be used by users, which are members of different groups. These users and groups are stored in my SQL database and are custom for my application, they are not Windows users. Every user can be member of many groups. What I need is a some kind of baseline, how to implement security in my app, based on these users and groups. By security I mean enabling and disabling different functionality of...
8
1144
by: jcrouse | last post by:
I have a test app with one button and a context menu. When I click on the button, it adds a label with some properties, one being the assignment of the context menu. If I add 5 buttons then want to delete one I can right click and choose Delete from the context menu. The problems is that I don't know the proper verbage to search for (in help) to find the code to tell which label is the one the received the right click event. I'm not sure if...
3
1244
by: Bernie Yaeger | last post by:
The context menu is a form level control. Is there a way to affix a context menu, not to the form, but rather to one of the controls instead? Thanks for any help. Bernie Yaeger
0
2020
by: Frnak McKenney | last post by:
Can I use a bound ComboBox for both browsing and editing? I'm working on a small, standalone database application using Visual C#.NET 2003 and an Access data file. In order to keep the number of different screens down to a minimum, I'm trying to use the same Windows Forms for both browsing and for updating. This works fine for TextBoxes, but I'm running into problems with my DropDownLists (ComboBoxes).
2
2074
by: Arno R | last post by:
For some reason I don't have a context (right-click) menu anymore for my controls in designmode. I DO heave a context menu for the form or report itself but not for the controls ??? What have I done wrong?? How to correct ?? Must be something I am overlooking but what ??? I do have several Access-installations on my machine (always have...) The problem happens on my machine for both Access2000 and Access2003 For Access '97 (and also...
1
1715
by: Phill W. | last post by:
What's the "proper" way of handling this? I have a base Control that offers a small set of options via its ContextMenu. I've now inherited from this and would like to add additional items to this Context Menu structure but how best to do so? Do I override the ContextMenu property in the sub-class, grab the value of MyBase.ContextMenu and append to it?
7
3887
by: akshaycjoshi | last post by:
I am making one form by hand (without vs 2005). i am positioning the menustrip above the toolstrip but still bue to some reason the menu strip is below it. I inseted breakpoint and when the code goes through this the data is MainMenu.Location = {X = 0 Y = 25} OneToolStrip.Location = {X = 0 Y = 0} why is this happening ?
0
9715
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10603
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10353
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10356
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9176
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5536
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4314
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3836
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3003
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.