T
tonFrere
Hello all,
I did a lot of research on the subject and came to the
conclusion that what I want to do might not be "good practice". I
created a set of table to manage user rights to forms in my solution
and hope I might be able to auto-generate the menu at solution startup.
I successfully created the menu structure but am stuck trying to add
code to the click event of my menuitems.
The database sends me the string name of the form to open. Now, how can
I instantiate a form by it's string name? Did I mention that I'm new to
OOP... I realise that I might be completely wrong trying to do such
thing. Is there a better approach to creating dynamic menus?
Hope this is clear enough...
Herre is how I generate the click event for each menuitem:
tsCont.Click += new System.EventHandler(this.toolStrip_Click);
Here is my test code for the click event:
private void toolStrip_Click(object sender, System.EventArgs e)
{
MessageBox.Show("Test");
}
I need to open the form refered by the "project" string property of the
sender object (class is tsmiWithProject)?
Thanks!
Justin
I did a lot of research on the subject and came to the
conclusion that what I want to do might not be "good practice". I
created a set of table to manage user rights to forms in my solution
and hope I might be able to auto-generate the menu at solution startup.
I successfully created the menu structure but am stuck trying to add
code to the click event of my menuitems.
The database sends me the string name of the form to open. Now, how can
I instantiate a form by it's string name? Did I mention that I'm new to
OOP... I realise that I might be completely wrong trying to do such
thing. Is there a better approach to creating dynamic menus?
Hope this is clear enough...
Herre is how I generate the click event for each menuitem:
tsCont.Click += new System.EventHandler(this.toolStrip_Click);
Here is my test code for the click event:
private void toolStrip_Click(object sender, System.EventArgs e)
{
MessageBox.Show("Test");
}
I need to open the form refered by the "project" string property of the
sender object (class is tsmiWithProject)?
Thanks!
Justin