Hello,
I'm generating a MainMenu in c# from a dataset, and one of the fields
is the shortcut. How can I add something like this:
if (dr["SHORTCUT"].ToString() != string.Empty)
m_menuitem.Shortcut = dr["SHORTCUT"].ToString();
I'm sure that the above code doesn't work, but I'm a junior C#
developer so I need some help here...
Ideally, the column SHORTCUT should contain for example CtrlO or F4,
but I could live with for example 24, a constant referencing to an
array with shortcut enumerations, to translate for example to
Shortcut.CtrlO.
What I would like to avoid is a massive Switch statement, where I have
to test for every possible value.
Thank you for your suggestions ,
Dirk