Results 1 to 4 of 4

Thread: VB Help, i am a 2 day newbie!

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Aug 2000
    Location
    Dullawhere
    Posts
    100

    Question

    When I click a command button, I want it to open up a new form. Code for that?And how do I make sure the second(3rd, 4th) form doesn't open up when you start the program? I could really use help becuase I am stuck in a program I am making. So, thanx anybody.

    [Edited by andymannewbie on 08-24-2000 at 10:04 AM]

  2. #2
    Member
    Join Date
    Aug 2000
    Location
    UK, Bedfordshire
    Posts
    49
    the proptery for form is:

    form1.show ' shows form 1
    form2.show ' shows form 2

    form1.hide ' hides form 1
    form2.hide ' hides form 2

    unload form1 ' unloads form 1
    unload form2 ' unloads form 2!

    so to show form 1 when button1 is clicked:

    private sub command1_click()
    form1.show
    end sub

    so to hide form 1 when button1 is clicked:

    private sub command1_click()
    form1.hide
    end sub
    Thanx, for your reply(s)

    Zhang Tian Hao
    Visual Studio Enterprise 6.0 SP 4
    [email protected]

  3. #3
    Lively Member fujiyama17's Avatar
    Join Date
    Aug 2000
    Location
    Columbus, OH
    Posts
    91
    I totally feel your pain about being new to VB. I just started myself, but I can tell you what I know!!

    It's real easy to open a form. Say you want to do it under a button on form1 to open form2

    =-=-=-=-=-=
    Private Sub Command1_Click()
    form2.show
    End Sub


    And to answer your other question, check your Modules, and make sure that there is nothing there that is opening up your other forms. It sounds to me that there is. Hope I helped!

    ~Brian

  4. #4
    Guest
    When you start your program, only the StartUp object is loaded so you don't need to worry about 2nd, 3rd, 4th etc. Forms loading.

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