Results 1 to 6 of 6

Thread: Help

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Sep 2003
    Posts
    68

    Question Help

    Hi, i got 2 forms, form 1 & form 2 using vb.net.

    When i run e pj, it should be form 1 running first. But form 2 is running in e 1st place, not form 1. Wat should i do to let form 1 to run first?

    Then if form 1 got a button, when clicked it should go to form 2, wat code should i add in?
    Private Sub btn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn.Click
    form2.show()
    End Sub

    But got error lei?

    Pls help me...

  2. #2
    Fanatic Member robbedaya's Avatar
    Join Date
    Jul 2002
    Location
    Belgium
    Posts
    872
    VB Code:
    1. Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    2.         Dim frm2 As New Form2()
    3.         frm2.Show()
    4.     End Sub
    - Use the thread tools to Mark your Thread as Resolved when your question is answered.
    - Please Rate my answers if they where helpful.

  3. #3
    Fanatic Member robbedaya's Avatar
    Join Date
    Jul 2002
    Location
    Belgium
    Posts
    872
    Goto the Project properties --> Set "startup Obect" to "Form1"
    - Use the thread tools to Mark your Thread as Resolved when your question is answered.
    - Please Rate my answers if they where helpful.

  4. #4

    Thread Starter
    Lively Member
    Join Date
    Sep 2003
    Posts
    68
    Hello, but under e properties page, i dun have e startup object lei, only got startup position.
    Please help me..

  5. #5
    Fanatic Member robbedaya's Avatar
    Join Date
    Jul 2002
    Location
    Belgium
    Posts
    872
    Menu -> Project -> Properties

    then a windows pops up, Then you choose

    common properties -> General -> en then you should have a combobox with the startup object.

    I think you're looking at the properties of your form, not your project
    - Use the thread tools to Mark your Thread as Resolved when your question is answered.
    - Please Rate my answers if they where helpful.

  6. #6

    Thread Starter
    Lively Member
    Join Date
    Sep 2003
    Posts
    68
    Thanks for it, i got it e startup form liao.

    But e show when clicked, still got prob lei, dun noe y. I doing in vb.net, not much different fr vb hor?

    Sorrie ah, cos i a newbie in vb.net, didnt use b4.

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