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

menu items: how to add?

I understand how to add a menu item at the current level:

Me.mnuTopics.MenuItems.Add("MenuItem1", AddressOf MenuClickhandler)

But, how do you add a child menu item to this level (in other words start a
sub-menu of the current menu level)?

Thanks
Nov 20 '05 #1
5 941
"tmaster" <le*******@travelmasterusa.com> schrieb
I understand how to add a menu item at the current level:

Me.mnuTopics.MenuItems.Add("MenuItem1", AddressOf
MenuClickhandler)

But, how do you add a child menu item to this level (in other words
start a sub-menu of the current menu level)?


The add method returns a MenuItem object. Currently you are ignoring the
return value. Assign it to a variabl and do the same as above
(var.menuitems.add ...)
--
Armin

http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #2
Cor
Hi Tmaster,

If I have such problems, one of the solutions to solve it is
- to look in MSDE
- do it with the designer and looks than what the designer did create.
- place a message here

Did you do it already with the designer?

(You can see that, if you do not know that by clicking on the + in Windows
Designer Generated Code

Cor
Me.mnuTopics.MenuItems.Add("MenuItem1", AddressOf

MenuClickhandler)


Nov 20 '05 #3
Cor
Hi Armin,

Did I made a message (in a sometimes) Armin Zingler style gives Armin an
answer.

:-))))

Cor
Nov 20 '05 #4
Sounds good. But, when I am handling a click, how do I reference the current
menu item (or how do I get its index)?

I think that this references the first item (at this level?):
MenuItem = mnuTopics.MenuItems.Item(0)

Thanks

"Armin Zingler" <az*******@freenet.de> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
"tmaster" <le*******@travelmasterusa.com> schrieb
I understand how to add a menu item at the current level:

Me.mnuTopics.MenuItems.Add("MenuItem1", AddressOf
MenuClickhandler)

But, how do you add a child menu item to this level (in other words
start a sub-menu of the current menu level)?


The add method returns a MenuItem object. Currently you are ignoring the
return value. Assign it to a variabl and do the same as above
(var.menuitems.add ...)
--
Armin

http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #5
"tmaster" <le*******@travelmasterusa.com> schrieb
Sounds good. But, when I am handling a click, how do I reference the
current menu item (or how do I get its index)?


The 'sender' argument is the reference to the clicked item. Use
Directcast(sender, menuitem)
type type-cast the reference to a MenuItem reference, eg.:

dim mi as menuitem
mi = directcast(sender, menuitem)

Access mi here.
To compare references, use the Is comparison operator.
--
Armin

http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #6

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

Similar topics

2
by: Jackson Yap | last post by:
can someone kind enough to help me look at the attached html and js file? Why is it that the javascript menu could not work at www.apchosting.net but could work at...
8
by: Dennis C. Drumm | last post by:
Is there a way to modify the standard context menu shown when someone right clicks in a windows text box and that would work for all open windows applications? The standard context menu for...
6
by: Sandy | last post by:
Hello - I have a book that illustrates pulling menu items from a Sql Server table into an ascx via a stored procedure. Is this something that is done in the real world? I do like the effect...
1
by: goRide | last post by:
Hi, I'm looking of a way (preferred - a ready class or dll) to customize the context menu. many application has more controls inside the context menu (like textbox, sliders, checkbox, panel...
1
by: Anthony | last post by:
Below is a script I found at http://javascript.internet.com/ for a cascading menu. The script works great but there is one thing that I would like modified. BecauseI am just learning javascript,...
2
by: MCM | last post by:
I'm working on a plotting control. The plotting control will have a context menu with basic commands for "scaling", "zooming", etc. Is there a way that, from the parent form, I can add more...
4
by: TycoonUK | last post by:
Hi, As I do not have IE7 on my computer, I was wondering if there is a fault in my CSS Menu when using IE7. Please can someone look at my site - http://www.worldofmonopoly.co.uk and tell me...
1
by: =?Utf-8?B?QW5kcmV3?= | last post by:
Hi, friends, I am using C#.net 2005 to create a windows application. It has menu items, such as File, etc. Under File, there are more menu items, such as New Files, Working Files, etc. Under...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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...

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.