Open a form from a windows control

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello All,

I have created a windows control using C#, which has some textboxes and a
datagrid, I want to add an event handler to the datagrid, when the user
clicks on a specific row it should open an instance of a form that exist in
the application which will user that control.
The problem is how can I declare the instance of that form (the form
constructor takes 2 parameters) in the control?

Thanks

Regards,
 
It depends on how your constructor for your NewForm is used, what your
parameters are, etc.

Try something like this:

Parameter1 param1;
Parameter2 param2;
NewForm1 = new NewForm(param1, param2);
 
Back
Top