C
Crumpet
**
[If you saw this post earlier as a reply, please excuse this second post as
my original post was named the same as another thread and got subsumed into
as a reply rather than getting posted as OP]
**
I have a menu with a number of items that I want to handle their being
clicked on with just one handling method.
What I want is for the even handler method to recognize which menu item got
clicked. What is considered the best way to do that?
e.g.
private void miClick(object sender, EventArgs e)
{
string displaystring = e.ToString();
MessageBox.Show(displaystring, "For your information", MessageBoxButtons.OK,
MessageBoxIcon.Information);
}
I can get some specific info but it seems rather convoluted. If I click on
the "About" menu item then the MessageBox will read:
"For your information
System.Windows.Forms.MenuItem, Items.Count: 0, Text: &About
OK"
Do I have to use some sort of regex or is there an easier way to identify
the specific menu item that was click?
Thanks
[If you saw this post earlier as a reply, please excuse this second post as
my original post was named the same as another thread and got subsumed into
as a reply rather than getting posted as OP]
**
I have a menu with a number of items that I want to handle their being
clicked on with just one handling method.
What I want is for the even handler method to recognize which menu item got
clicked. What is considered the best way to do that?
e.g.
private void miClick(object sender, EventArgs e)
{
string displaystring = e.ToString();
MessageBox.Show(displaystring, "For your information", MessageBoxButtons.OK,
MessageBoxIcon.Information);
}
I can get some specific info but it seems rather convoluted. If I click on
the "About" menu item then the MessageBox will read:
"For your information
System.Windows.Forms.MenuItem, Items.Count: 0, Text: &About
OK"
Do I have to use some sort of regex or is there an easier way to identify
the specific menu item that was click?
Thanks