vb.net - Generate code when correct picturebox is clicked -
i making game kids learn different parts of objects part of 9th grade tech class syllabus. there picture of plane , 6 smaller pictures underneath it. 3 of pictures components of plane, others won't.
only when person playing has clicked 3 right components win game.
i can't figure out way code program 3 pictures need clicked before program advances.
take 7 picturebox
saying, suppose main picturebox
picturebox1 , underneath ones picturebox2
, picturebox3
, picturebox4
, picturebox5
, picturebox6
, picturebox7
.
if correct picturebox
2, 3, 4, then, write following code under 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 'things here want when correct pictures clicked end if end sub
i hope understand!
Comments
Post a Comment