[RESOLVED] [2005] Second form stays blank.
Hi All,
I'm trying to show a second form with several controls on it, but after showing the second form stays blank!
This is how I create a second form:
Project -> Add Windows Form -> Windows Form -> Add = Ok my second form2 is created! I've putted some controls on that Form2!
In form1, I've created a button1 to show my second form like this:
VB Code:
Dim Form2 As New Form
Form2.Show()
What did I do wrong that after the second form is showing that it still stays Blank! (means without any control and Formname)
Thanks in advance,
sparrow1
Re: [2005] Second form stays blank.
Two things to check.
1. Dim Form2 as new Form() ' <-- Should this be Form2() !!! (My Guess:P)
2. Check InitializeComponents is being called in the new routine of your second form
Re: [2005] Second form stays blank.
The code that is written is not correct. You are creating an object using the Form class and not the Form2 class. This is the reason why it is Blank. Use this
VB Code:
Dim fTemp As New Form2
fTemp.Show()
Re: [2005] Second form stays blank.
Thanks Duck and Ali for your quick reply! :thumb:
Wkr,
sparrow1