I have a usercontrol with a single combobox. I would like to use this same usercontrol on
two different forms. On each form, I seem to add the usercontrol properly, as it is visible on those forms:
On the usercontrol, I will get the index in the combobox through the SelectedIndexChanged() event.
Then, based on which of the two forms I am on, I would call the appropriate method. How, from the usercontrol,
can I tell which of the two forms that I am on, so that I know whether to call myform1.thefunction() or myform2.thefunction()?
Thanks in advance.
two different forms. On each form, I seem to add the usercontrol properly, as it is visible on those forms:
myusercontrol control = new myusercontrol(); control.show(); myform1.Controls.Add(control);
On the usercontrol, I will get the index in the combobox through the SelectedIndexChanged() event.
Then, based on which of the two forms I am on, I would call the appropriate method. How, from the usercontrol,
can I tell which of the two forms that I am on, so that I know whether to call myform1.thefunction() or myform2.thefunction()?
Thanks in advance.