W
www.dir
Hi,
I am adding dynamically context menu items like this:
MenuItem newStudent = new MenuItem( student.Name );
newStudent .Click += new System.EventHandler( this.StudentClicked );
And my method :
void StudentClicked ( object sender, System.EventArgs e )
{
}
And It is working just fine.
The problem is that I have only one method executed for every student
the User clicks on the context menu. I need to add a parameter or
something so when the StudentClicked method is executed I will know
which MenuItem ( Student ) was clicked. Normally I would add a student
number in the tag field, and when a the StudentClicked method is
executed I would get the tag, parse the number and I know thick student
was pressed on the menu. But MenuItems do not have tag.
Please advise.
I am adding dynamically context menu items like this:
MenuItem newStudent = new MenuItem( student.Name );
newStudent .Click += new System.EventHandler( this.StudentClicked );
And my method :
void StudentClicked ( object sender, System.EventArgs e )
{
}
And It is working just fine.
The problem is that I have only one method executed for every student
the User clicks on the context menu. I need to add a parameter or
something so when the StudentClicked method is executed I will know
which MenuItem ( Student ) was clicked. Normally I would add a student
number in the tag field, and when a the StudentClicked method is
executed I would get the tag, parse the number and I know thick student
was pressed on the menu. But MenuItems do not have tag.
Please advise.