Results 1 to 2 of 2

Thread: My first bit of questions! (HELP!!!)

  1. #1

    Thread Starter
    New Member
    Join Date
    Sep 2000
    Posts
    1

    Exclamation

    hi, I am working on a game in VB and i am just learning but i need to know some things, I have a 400 page book but i dont really want to read all through it!
    now what i need to know is the code to...
    -attach one screen to another(I.E.: User clicks continue, it takes him to the next screen"
    -Insert Videos
    -Place numbers from one place to another to add up. (I.E.: the user chooses the # 4 as his fav #. then he clicks on continue, and he goes to the next screen that says "Your fav # is 4" "Your friends Fav # is 6 that equals 10")
    -Have one users selection go onto the next screen with them (I.E.: the user chooses the # 4 as his fav #. then he clicks on continue, and he goes to the next screen that says "Your fav # is 4")

    I think that is all for now, please help me!!

    Thanks alot
    I am working on a game in VB and i need help!!

  2. #2
    Fanatic Member
    Join Date
    Apr 2000
    Location
    Whats a location?
    Posts
    516
    Add a Module (not a Class Module, but a BAS one)

    In that, put:

    Code:
    Global FavNumber As Integer
    Then in one of the forms put

    Code:
    'This is just an example
    FavNumber = CInt(Text1.Text)
    In one of the other forms put

    Code:
    Label1.Caption = "Your favourite number is " & FavNumber
    In another form put

    Code:
    Label1.Caption = "Your favourite number is " & FavNumber & ". Your friends number was " & AnyOldVariable & " and together they equal " & (FavNumber + AnyOldVariable)
    To have the 'next form' display you want:

    Code:
    'If this is the last time you are ever going to show the form this code is in then use this:
    
    Private Sub Command1_Click()
    Load frmNextForm 'Use all this to make sure it loads ;)
    frmNextForm.Visible = True
    frmNextForm.Show
    
    'Unload this form permanently:
    Unload Me
    End Sub
    Code:
    'If this is not the last time you are ever going to show the form this code is in then use this:
    
    Private Sub Command1_Click()
    Load frmNextForm 'Use all this to make sure it loads ;)
    frmNextForm.Visible = True
    frmNextForm.Show
    
    Me.Hide 'Just hide the form
    End Sub
    About the above code (about forms) you need to put this code in each of the continue buttons on all of the forms. Also, it might be easier to name the forms in order, so you end up with something like this:
    Code:
    'One of the forms:
    Private Sub Command1_Click()
    
    Load frmNextForm1
    frmNextForm1.Visible = True
    frmNextForm1.Show
    
    Me.Hide 'Just hide the form
    End Sub
    
    'The Next Form
    Private Sub Command1_Click()
    
    Load frmNextForm2
    frmNextForm2.Visible = True
    frmNextForm2.Show
    
    Me.Hide 'Just hide the form
    End Sub
    I hope you understand now, I hope.

    I'm not quite sure about adding videos, maybe you could do something with the OLE control, but that's not my area or expertise
    Courgettes.

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