Making a Quiz - Help! How to Open new form???

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • vb08isgreat
    New Member
    • Feb 2008
    • 6

    Making a Quiz - Help! How to Open new form???

    Alright, this is how it is.
    I'm making a quiz game on Visual Basic 2008 Express Edition.
    There is 25 questions, and each form is one question.

    I have the splash screen done, and then form one loads.
    i want it so that when the user clicks the button with the correct answer, a message box appears saying: "Correct!" And then a little bit of information about the question.

    the the next form pops up when the user click OK.

    Please help!!!!



    Thanks

    08
  • kadghar
    Recognized Expert Top Contributor
    • Apr 2007
    • 1302

    #2
    Originally posted by vb08isgreat
    Alright, this is how it is.
    I'm making a quiz game on Visual Basic 2008 Express Edition.
    There is 25 questions, and each form is one question.

    I have the splash screen done, and then form one loads.
    i want it so that when the user clicks the button with the correct answer, a message box appears saying: "Correct!" And then a little bit of information about the question.

    the the next form pops up when the user click OK.

    Please help!!!!



    Thanks

    08
    I dont think using a form for each question is healthy. Try just changing the caption of the label or the text of the textbox each time.

    Anyway, to show the message, just do something like


    [CODE=vb]msgbox "Thats right!" & chr(13) & chr(13) & "The smurfs lived inside mushrooms called Amanita Muscaria, also Toad, the Super Mario character, belongs to this specie"[/CODE]

    Chr(13) is for going to the next line

    to show a form, use its Show method:

    Form2.show

    Or the equivalent method in VB2008 xpress (which i've not downloaded yet =()

    HTH

    Comment

    • Killer42
      Recognized Expert Expert
      • Oct 2006
      • 8429

      #3
      Please help with what, exactly? We're not here to create the program for you - you need to be specific about what part is giving you trouble, and give us an idea of what you've tried so far.

      Comment

      • vb08isgreat
        New Member
        • Feb 2008
        • 6

        #4
        Originally posted by Killer42
        Please help with what, exactly? We're not here to create the program for you - you need to be specific about what part is giving you trouble, and give us an idea of what you've tried so far.
        i wasn't specific??? umm... ok
        i have a form for each question.
        i want to close the current form and open a new one when someone clicks a button.
        i haven't tried anything yet because i don't have any clue about the codes.
        get it?

        Comment

        • baillie11
          New Member
          • Feb 2008
          • 2

          #5
          Are you using MDI/Child Forms??

          I tend to use the following code when I am NOT using a MDI/Child set up and it works well.

          Be careful though because if you need to calculate scores etc you will need to reference the answers from each form to total them up at the end.

          Form2.Show()
          Me.Hide()
          Last edited by Killer42; Feb 22 '08, 12:37 PM.

          Comment

          • debasisdas
            Recognized Expert Expert
            • Dec 2006
            • 8119

            #6
            Originally posted by vb08isgreat
            ............... ............
            i haven't tried anything yet ............... ..........
            If you have not tried anything ,what do you expect from us ???

            Comment

            • Ali Rizwan
              Banned
              Contributor
              • Aug 2007
              • 931

              #7
              Hello,
              Instead of putting a lot of forms use some database or some kind of text file at back end to generate questions.

              Next
              To show a msg box and viewing the next form use this code.

              Code:
              msgbox "Correct!" & VBNewLine & "Your information about the question"
              Form2.Show
              Me.Hide
              Regards
              >> ALI <<

              Comment

              Working...