form.Show not displaying any of the controls on the Form

  • Thread starter Thread starter KenR
  • Start date Start date
K

KenR

When I create a form (Dim f as New Form1) and try to
display it using the f.Show method, the form shows, but no
controls do. I have a textbox and a progressbar on the
form.

It displays fine using f.ShowDialog, but I need the form
to be modeless.
 
KenR said:
When I create a form (Dim f as New Form1) and try to
display it using the f.Show method, the form shows, but no
controls do. I have a textbox and a progressbar on the
form.

It displays fine using f.ShowDialog, but I need the form
to be modeless.

Maybe you are starting any job after showing the Form, so the Form does not
have the time to paint itself. If this is true, call the refresh method
directly after showing the Form.
 
Did you write an additional Constructor with parameters for the form? If
so, you have to make sure to call Me.New(), not MyBase.New(), since the
InitializeComponent() procedure is called in the automatically-generated
parameterless Constructor. If this procedure is not called, the controls
will not be drawn. I made the exact same mistake just a short while ago.

Mike

--


Michael Caputo
Programmer/Database Administrator
Simon Economic Systems Ltd.
 
No, I'm not sure what you mean. In VB6, you just called
the form. The form does not have any parameter that I
created. Any additional insite would be appreciated as I
am new to vb.net.
Ken.
 
Back
Top