How to show a form from a usercontrol 
Author Message
 How to show a form from a usercontrol

I would like to show a form by calling a method of a usercontrol, can anyone
advise how to do this.

eg :  myControl.ShowInfoForm() and have the FrmInfo shown.



Thu, 17 Jun 2004 06:24:29 GMT  
 How to show a form from a usercontrol
Patrick & Helga,
Use something like:

class UserControl1
{
    void ShowInfoForm()
    {
        FrmInfo frm = new FrmInfo();
        frm.Show();
    }

Quote:
}

There is also a ShowDialog method which will show the form Modally.

Hope this helps
Jay



Quote:
> I would like to show a form by calling a method of a usercontrol, can
anyone
> advise how to do this.

> eg :  myControl.ShowInfoForm() and have the FrmInfo shown.



Thu, 17 Jun 2004 06:49:36 GMT  
 How to show a form from a usercontrol

Quote:
> I would like to show a form by calling a method of a usercontrol, can
anyone
> advise how to do this.

> eg :  myControl.ShowInfoForm() and have the FrmInfo shown.

Just create a new instance of the form class and call .Show() on it?

--
Tomas Restrepo



Thu, 17 Jun 2004 06:53:32 GMT  
 How to show a form from a usercontrol
Thanks....


Quote:
> I would like to show a form by calling a method of a usercontrol, can
anyone
> advise how to do this.

> eg :  myControl.ShowInfoForm() and have the FrmInfo shown.



Thu, 17 Jun 2004 08:55:03 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. UserControl does not show on running form and properies do not show

2. A UserControl is shown as a class..

3. system.windows.forms.form.show()

4. Broken Show() and Hide() for Forms.Form.TabPage

5. modeless form using form.Show() method in C#

6. add userControl to my form

7. Usercontrol and Form in same dll

8. TextBox inside UserControl DataBinding with DataGrid outside UserControl

9. ref-count problem after showing a .NET form in a MFC app

10. How can I override the Form.Show method?

11. How can I build and show forms at runtime

12. Load form without showing it.

 

 
Powered by phpBB® Forum Software