A
Aliaksandr Radzivanovich
Is there any way to associate some variable with a MenuItem object?
Most of the controls in Windows Forms have Tag property that holds anything
that you assing to it. It is very useful, but unfortunately MenuItem doesn't
have this property. The only customizable item is Text property, which is
not enough to me.
I my projet I create a menu, populate its items dynamically (using list of
files in a folder, for exapmle), attach one event handler to all the items.
How to make the event handler to receive some identifier from a clicked menu
item?
I want to show meaningful user-friendly text in menu items, that's why I
can't use Text property as a parameter for my event handler, after all,
there may be duplicates in names I want to show in menu items.
Does anybody know how to help me?
Thanks.
Most of the controls in Windows Forms have Tag property that holds anything
that you assing to it. It is very useful, but unfortunately MenuItem doesn't
have this property. The only customizable item is Text property, which is
not enough to me.
I my projet I create a menu, populate its items dynamically (using list of
files in a folder, for exapmle), attach one event handler to all the items.
How to make the event handler to receive some identifier from a clicked menu
item?
I want to show meaningful user-friendly text in menu items, that's why I
can't use Text property as a parameter for my event handler, after all,
there may be duplicates in names I want to show in menu items.
Does anybody know how to help me?
Thanks.