Amigos do MSDN, montei a rotina abaixo e não estou conseguindo que o botão desinfle, ele só infla. Alguém por favor, modifique essa rotina para que funcione corretamente.
Public Class Form1
Dim dez(3) As Integer
Dim i As Integer
Dim v As Integer
Private Sub PictureBox_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PictureBox1.Click, PictureBox2.Click, PictureBox3.Click
Dim botaoSoma = New PictureBox() {PictureBox1, PictureBox2, PictureBox3}
Dim botaoSubtrai = New PictureBox() {PictureBox4, PictureBox5, PictureBox6}
Dim caixa = New TextBox() {TextBox1, TextBox2, TextBox38}
For u = 0 To 2
If sender Is botaoSoma(u) Then
With botaoSoma(u)
Dim R As Rectangle = botaoSoma(u).Bounds
R.Inflate(5, 5)
botaoSoma(u).Bounds = R
dez(u) += 1
caixa(u).Text = dez(u)
'i = u
Exit For
End With
End If
Next
For u = 0 To 2
If sender Is botaoSubtrai(u) Then
With botaoSubtrai(u)
Dim R As Rectangle = botaoSubtrai(u).Bounds
R.Inflate(5, 5)
botaoSubtrai(u).Bounds = R
dez(u) -= 1
caixa(u).Text = dez(u)
'v = u
Exit For
End With
End If
Next
Timer1.Interval = 70
Timer1.Start()
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Dim botaoSoma = New PictureBox() {PictureBox1, PictureBox2, PictureBox3}
Dim botaoSubtrai = New PictureBox() {PictureBox4, PictureBox5, PictureBox6}
If sender Is botaoSoma(i) Then
With botaoSoma(i)
Dim R As Rectangle = botaoSoma(i).Bounds
R.Inflate(-5, -5)
botaoSoma(i).Bounds = R
End With
End If
If sender Is botaoSubtrai(v) Then
With botaoSubtrai(v)
Dim R As Rectangle = botaoSubtrai(i).Bounds
R.Inflate(-5, -5)
botaoSubtrai(i).Bounds = R
End With
End If
Timer1.Stop()
End Sub
End Class