Generate code when correct picturebox is clicked

Course Queries Syllabus Queries . 2 years ago

  0   2   0   0   0 tuteeHUB earn credit +10 pts

5 Star Rating 5 Rating

Posted on 16 Aug 2022, this text provides information on Syllabus Queries related to Course Queries. Please note that while accuracy is prioritized, the data presented might not be entirely correct or up-to-date. This information is offered for general knowledge and informational purposes only, and should not be considered as a substitute for professional advice.

Take Quiz To Earn Credits!

Turn Your Knowledge into Earnings.

tuteehub_quiz

Write Your Comments or Explanations to Help Others



Tuteehub forum answer Answers (2)


profilepic.png
manpreet Tuteehub forum best answer Best Answer 2 years ago

I am making a game to help kids learn the different parts of objects as a part of 9th grade tech class syllabus. There will be a picture of a plane and 6 smaller pictures">pictures underneath it. Only three of the pictures">pictures will be components of a plane, the others won't.

Only when the person playing has clicked the three right components will they win the game.

I can't figure out a way to code my program so that all three pictures">pictures need to be clicked before my program advances.

0 views   0 shares
profilepic.png
manpreet 2 years ago

Take 7 picturebox as you are saying, suppose the main picturebox is Picturebox1 and the underneath ones are Picturebox2Picturebox3Picturebox4Picturebox5Picturebox6Picturebox7.

If correct PictureBox are 2, 3, 4, then, write the following code under their click events.

Private Sub Form1_Load () Handles Mybase.Load
       Textbox1.Hide
       Textbox1.Text = 0
End Sub

Private Sub Picturebox2_Click () Handles Picturebox2.Click
       Textbox1.Text = Val(Textbox1.text) + 1
End Sub

Private Sub Picturebox3_Click () Handles Picturebox3.Click
       Textbox1.Text = Val(Textbox1.text) + 1
End Sub

Private Sub Picturebox3_Click () Handles Picturebox3.Click
       Textbox1.Text = Val(Textbox1.text) + 1
End Sub

Private Sub Textbox1_TextChanged () Handles Textbox1.TextChanged
       If Val(Textbox1.Text) = 3 then
            'things here you want to do when correct pictures are clicked
       End If
End Sub

I hope you will understand!


0 views   0 shares

No matter what stage you're at in your education or career, TuteeHub will help you reach the next level that you're aiming for. Simply,Choose a subject/topic and get started in self-paced practice sessions to improve your knowledge and scores.

tuteehub community

Join Our Community Today

Ready to take your education and career to the next level? Register today and join our growing community of learners and professionals.

tuteehub community