Picture changing in vb6 -


I was trying this script from a PDF file. I thought where the image on the image should be changed in the target image blast, image image.Please help with the image does not change!

  Options clear dim fiPlayersScore integer dim fiNumberofMisses integer dim fbTargetHit as Boolean Private Sub Form_Load () randomize imgTarget.Enabled = as false imgTarget as Visible = Wrong cmdStop.Enabled Enter = False lblGameOver.Visible = False lblGameOver.Enabled = False End Sub Private Sub cmdStart_Click () levels as low lsUserResponse Bolian lsUserResponse = String Dim lbResponse as InputBox ( "from 1 to 3 "& Amp; _ (Crow (13)) and" "and (Crow (13)) and" 1 easiest and 3 being "and" Hardest, "" Level Selection "," 1 ") lbResponse = False lsUserResponse = "1" then Timer1.Interval = 1500 lbResponse = true elseif lsUserResponse = "2" then Timer1.Interval = 1000 lbResponse = true elseif lsUserResponse = "3" then Timer1.Interval = 750 lbResponse = true else MsgBox ( "Game did not start.") LbResponse = false end If lbResponse = true then cmdStart.Enabled = false imgTarget.Picture = imgStanding.Picture frmMain.MousePointer = 5 FbTargetHit = False Load_Sounds cmdStop.Enabled = True fiPlayersScore = 0fnumberofMisses = 0 lblScore.Caption = FiPlayersScore lblMisses.Caption = fiNumberofMisses Timer 1. Enabled = True lblGameOver.Visible = False lblGameOver.Enabled = False End if finished sub sub subcmd cmdStop_Click () unload_SoundsFrmMain.MousePointer = vbNormal Timer1.Enabled = False imgTarget.Enabled = False imgTarget.Visible = False cmdStart.Enabled = True cmdStop .Enabled = False cmdStart.SetFocus lblGameOver.Visible = True lblGameOver.Enabled = True End Sub Private Sub Form_Click () MMControl1.Command = "Play" MMControl1.Command = "Previous" fiNumberofMisses = fiNumberofMisses + 1lblMisses.Caption = fiNumberofMisses Then CheckForLoose = truth cmdStop_Click lblMisses.Caption = fiNumberofMi sses Exit sub end end sub Private sub imgTarget_Click () MMControl2.Command = "Play" MMControl2.Command = "prev" Timer1.Enabled = false imgTarget.Picture = imgExplode.Picture ' ** I'm stuck here ** UseProgram fiPlayersScore = FiPlayersScore + 1 Timer1.Enabled = TrueForWin = True then if cmdStop_Click lblScore.Caption = FiPlayersScore exit sub-end if lblScore.Caption = FiPlayersScore fbTargetHit = True imgStanding.Enabled = False imgTarget.Visible = False imgTarget.Enabled = False Timer1 .Enabled = set true initial property values ​​for End sub public sub Load_Sounds () 'Blaster sound MMControl1.Notify = false MMControl1.Wait = true MMControl1.Shareable = false MMControl1.DeviceType = "WaveAudio" MMControl1.FileName = _ " C: \ Temp \ Sound \ Blaster_1.wav "Open Media Device MMControl1.Command =" Open "Private Sub Timer1_Timer () Dim liRandomLeft integer dim liRandomTop Purna As as Nk imgTarget.Visible if it is true = fbTargetHit = truth fbTargetHit = false imgTarget.Picture = imgStanding.Picture finally liRandomLeft = (6120 * round) liRandomTop = (4680 * round) imgTarget.Left = liRandomLeft imgTarget.Top = liRandomTop imgTarget.Enabled = true imgTarget.Visible = true End Sub public function CheckForWin () as Boolean CheckForWin = false fiPlayersScore = 5 then CheckForWin = true lblGameOver.Caption = "more Win.Game" means Last if the expiration function is the Public Function CheckForLoose () as Boolean CheckForLoose = false FINumberofMisses = 5 then CheckForLoose = true lblGameOver.Caption = "You loose. More games "from the end other end functions are private sub Form_QueryUnload (cancel as integer, _UnloadMode as integer) Unload_Sounds End Sub Public Sub Unload_Sounds () MMControl1.Command =" Off "MMControl2.Command =" Closed "End Sub Public sub-pauseProgram (slow) slow down current time Newtime current time = second time (time) Newtime = second (time) until ABS (Newtime - current time)> = 1 Newtime = Second (time) Loop End Sub  

edit:

  imgTarget.Picture = imgExplode.Picture ImgTarget.Refresh  

Comments