|
-
Aug 2nd, 2006, 05:17 AM
#1
[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
-
Aug 2nd, 2006, 05:21 AM
#2
Hyperactive Member
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
-
Aug 2nd, 2006, 05:23 AM
#3
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()
Use [code] source code here[/code] tags when you post source code.
My Articles
-
Aug 2nd, 2006, 05:38 AM
#4
Re: [2005] Second form stays blank.
Thanks Duck and Ali for your quick reply!
Wkr,
sparrow1
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|