Results 1 to 6 of 6

Thread: show form, doesn't show controls

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Mar 2003
    Location
    Rhode Island, USA
    Posts
    29

    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?

  2. #2
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    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'?

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Mar 2003
    Location
    Rhode Island, USA
    Posts
    29

    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?

  4. #4
    Fanatic Member
    Join Date
    Sep 2002
    Posts
    518
    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.

  5. #5

    Thread Starter
    Junior Member
    Join Date
    Mar 2003
    Location
    Rhode Island, USA
    Posts
    29

    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

  6. #6
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339

    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
  •  



Click Here to Expand Forum to Full Width