G
Guest
Hi,
When creating a popup menu I find it rather difficult to provide the
eventhandler for the MenuItem with enough information. My actual problem is
that I create a popup menu with a list of objects of which one, by clicking
the item, must be assinged to another object. I use the same eventhandler for
all the menuitems in the popup menu as the objects listed in the popup menu
is of arbitrary length. To correlate the 'sender' menuitem in my eventhandler
with its corresponding object, I use menuitem.Index to get the position of
the menuitem in the popup window and then can deduct the position of the
corresponding object in an arraylist. It seems wrong to to it this way, I'm
so much missing the Tag field for menuitems....
Having any suggestions to a better way, please PLEASE reply on this.
Than you very much. Best regards Jesper, Denmark.
When creating a popup menu I find it rather difficult to provide the
eventhandler for the MenuItem with enough information. My actual problem is
that I create a popup menu with a list of objects of which one, by clicking
the item, must be assinged to another object. I use the same eventhandler for
all the menuitems in the popup menu as the objects listed in the popup menu
is of arbitrary length. To correlate the 'sender' menuitem in my eventhandler
with its corresponding object, I use menuitem.Index to get the position of
the menuitem in the popup window and then can deduct the position of the
corresponding object in an arraylist. It seems wrong to to it this way, I'm
so much missing the Tag field for menuitems....
Having any suggestions to a better way, please PLEASE reply on this.
Than you very much. Best regards Jesper, Denmark.