471,354 Members | 1,471 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

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

Menu item loop

I'm looking at a way to loop throught all menuitem object of a form,
including sub menu. From the form it self sub items doesn't matter
because i can access them directly without having to pass by parent
(i.e Open under File menu, i can call mnuOpen and don'y have to do
mnuFile.MnuOpen) ok you get the point.

I don't find any collection of these item. I have class that loop in
all form controls and check my Language XML file find the control and
check the text value for the current selected language. I manage to do
it for all controls and even special made controls. But i can't get
the menuitem to work. Form.Controls doesn't contain menuitem in there
so i guess there must be another way. I can make a special function
just for looping tru menuitem i have only 2-3 forms that need that
Aug 4 '08 #1
1 1719
On Mon, 04 Aug 2008 12:45:53 -0700, Franck <th***********@hotmail.com>
wrote:
I'm looking at a way to loop throught all menuitem object of a form,
including sub menu. From the form it self sub items doesn't matter
because i can access them directly without having to pass by parent
(i.e Open under File menu, i can call mnuOpen and don'y have to do
mnuFile.MnuOpen) ok you get the point.

I don't find any collection of these item. I have class that loop in
all form controls and check my Language XML file find the control and
check the text value for the current selected language. I manage to do
it for all controls and even special made controls. But i can't get
the menuitem to work. Form.Controls doesn't contain menuitem in there
so i guess there must be another way.
A ToolStripMenuItem is contained not by the Form instance, but instead by
a MenuStrip that is itself contained by the Form.

So you should first be searching for a MenuStrip, and then enumerating the
children of _that_.

Pete
Aug 4 '08 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Andrus Moor | last post: by
13 posts views Thread by Matthew Hagston | last post: by
2 posts views Thread by Jackson Yap | last post: by
2 posts views Thread by Tim::.. | last post: by
1 post views Thread by Dave | last post: by
8 posts views Thread by =?Utf-8?B?bWljaGFlbCBzb3JlbnM=?= | last post: by
2 posts views Thread by Sathish Kumar | last post: by
omerbutt
1 post views Thread by omerbutt | last post: by
reply views Thread by XIAOLAOHU | last post: by

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.