Putting Enum values on a Menu (instead of a combo box)

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I have a windows form application and currently have a enum defined and it
displays the selections on a combo box. The combo box contents are being
bound to the enum definition. E.g.
myCombo.DataSource = Enum.GetValues ( typeof ( myEnum ) );

I now have a need to display the same enum selections on a menu, so the user
could navigate to them.

Can't find how do do this in a smart way. The only way I am coming up with
is to iterate through the enum definition and add a menu item for each one.

Feel I'm missing something here, so any info would be appreciated. Thanks,

Laura
 
laurmo said:
bound to the enum definition. E.g.
myCombo.DataSource = Enum.GetValues ( typeof ( myEnum ) );

I now have a need to display the same enum selections on a menu, so the
user
could navigate to them.

Can't find how do do this in a smart way. The only way I am coming up
with
is to iterate through the enum definition and add a menu item for each
one.

AFAIK that's the only way.
 
Back
Top