|
-
May 6th, 2003, 12:13 AM
#1
Thread Starter
Junior Member
show form, doesn't show controls
i used the following code to show form2 but my controls aren't showing up. this code is in form1's command button.
dim form2 as new form
form2.show()
did i miss something?
-
May 6th, 2003, 12:20 AM
#2
Did you happen to make a new constructor and forget to call the old one in it? Or erase the old constructor? Did you make any methods called 'New'?
-
May 6th, 2003, 02:08 AM
#3
Thread Starter
Junior Member
my bad
I realized my mistake as soon as i posted it. thanks for the response! anyways could you explain to me why you have to
dim myform as new myform()
myform.show()
why do you have to make a new one? is it because the form is a class and you have to create an instance of it?
-
May 6th, 2003, 02:08 AM
#4
Fanatic Member
Heh, I think your problem is pretty straightforward:
dim form2 as new form
When you dim form2 as new form, this instantiates a new blank form, with no controls on it. I presume you have a form2.vb file in your project? You want to:
dim form2 as new [bform2[/b]
...or whatever the class name for the other form may be. You can actually describe a form completely from code and not use the designer but it doesn't sound like you did that.
-
May 6th, 2003, 02:09 AM
#5
Thread Starter
Junior Member
fixed!
hey thanks for the reply you said exactly what i did. i did new form() instead of the name of the form i already had. thanks man
-
May 6th, 2003, 02:34 AM
#6
Re: my bad
Originally posted by mmatteson
I realized my mistake as soon as i posted it. thanks for the response! anyways could you explain to me why you have to
dim myform as new myform()
myform.show()
why do you have to make a new one? is it because the form is a class and you have to create an instance of it?
That is exactly right.
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
|