Results 1 to 4 of 4

Thread: [RESOLVED] [2005] Second form stays blank.

  1. #1

    Thread Starter
    PowerPoster sparrow1's Avatar
    Join Date
    May 2005
    Location
    Globetrotter
    Posts
    2,820

    Resolved [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:
    1. Dim Form2 As New Form
    2. 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
    Wkr,
    sparrow1

    If I helped you, don't forget to Rate my post. Thank you

    I'm using Visual Studio.Net 2003 and
    2005
    How to learn VB.Net Create setup with VB 2005 Drawing for beginners VB.Net Tutorials GDI+ Tutorials
    Video's for beginners

  2. #2
    Hyperactive Member The_Duck's Avatar
    Join Date
    May 2005
    Location
    Leamington, UK
    Posts
    351

    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

  3. #3
    Shared Member
    Join Date
    May 2005
    Location
    Kashmir, India
    Posts
    2,277

    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:
    1. Dim fTemp As New Form2
    2. fTemp.Show()
    Use [code] source code here[/code] tags when you post source code.

    My Articles

  4. #4

    Thread Starter
    PowerPoster sparrow1's Avatar
    Join Date
    May 2005
    Location
    Globetrotter
    Posts
    2,820

    Re: [2005] Second form stays blank.

    Thanks Duck and Ali for your quick reply!

    Wkr,

    sparrow1
    Wkr,
    sparrow1

    If I helped you, don't forget to Rate my post. Thank you

    I'm using Visual Studio.Net 2003 and
    2005
    How to learn VB.Net Create setup with VB 2005 Drawing for beginners VB.Net Tutorials GDI+ Tutorials
    Video's for beginners

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