Menu item loop

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Franck

    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
  • Peter Duniho

    #2
    Re: Menu item loop

    On Mon, 04 Aug 2008 12:45:53 -0700, Franck <the_darkblast@ 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 ToolStripMenuIt em 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

    Comment

    Working...