Making User Control visible

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

Guest

Hi all,

I have a user control and a form. I want the user control to be visible when
the form is shown. I haven't found a good webtutorial on this so maybee
someone can help me out?

regards
Stijn
 
Hi Stijn
I don't see what is the problem with that. you just add your user control
to the from set its visible property to true and it should be visible when
the form load .
As long as you see it in on the IntializeComponeont() of the form
Mohamed Mahfouz
MEA Developer Support Center
ITworx on behalf of Microsoft EMEA GTSC
 
The control won't show up :-( I try to create an instance in the constructor
of the class after InitializeComponent(); but without succes. The component
won't sow up.

public MainForm()
{
//
// Required for Windows Form Designer support
//
InitializeComponent();
MainControl myMainControl = new MainControl();
myMainControl.Top = 0;
myMainControl.Left = 0;
myMainControl.Visible = true;
myMainControl.Show();
}
 
That 's an example on how to create a user control. I m looking for a way to
show it on a form...

Regards
Stijn
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top