Necesito Ayuda VB6.0 ( II )
Publicado por Noe (9 intervenciones) el 31/12/2003 21:42:30
Option Explicit
Dim x As Integer
Private Sub Ficha_KeyPress(KeyAscii As Integer)
Call Movimiento(KeyAscii)
End Sub
Function Movimiento(KeyAscii As Integer)
If KeyAscii = 50 Then
If Ficha.Top < 3360 Then
Ficha.Top = Ficha.Top + 360
Else
KeyAscii = 0
End If
End If
If KeyAscii = 56 Then
If Ficha.Top > 120 Then
Ficha.Top = Ficha.Top - 360
Else
KeyAscii = 0
End If
End If
If KeyAscii = 52 Then
If Ficha.Left > 120 Then
Ficha.Left = Ficha.Left - 360
Else
KeyAscii = 0
End If
End If
If KeyAscii = 54 Then
If Ficha.Left < 3000 Then
Ficha.Left = Ficha.Left + 360
Else
KeyAscii = 0
End If
End If
End Function
Private Sub Ficha2_KeyPress(KeyAscii As Integer)
Call Movimiento2(KeyAscii)
End Sub
Function Movimiento2(KeyAscii As Integer)
If KeyAscii = 50 Then
If Ficha2.Top < 3360 Then
Ficha2.Top = Ficha2.Top + 360
Else
KeyAscii = 0
End If
End If
If KeyAscii = 56 Then
If Ficha2.Top > 120 Then
Ficha2.Top = Ficha2.Top - 360
Else
KeyAscii = 0
End If
End If
If KeyAscii = 52 Then
If Ficha2.Left > 120 Then
Ficha2.Left = Ficha2.Left - 360
Else
KeyAscii = 0
End If
End If
If KeyAscii = 54 Then
If Ficha2.Left < 3000 Then
Ficha2.Left = Ficha2.Left + 360
Else
KeyAscii = 0
End If
End If
End Function
Dim x As Integer
Private Sub Ficha_KeyPress(KeyAscii As Integer)
Call Movimiento(KeyAscii)
End Sub
Function Movimiento(KeyAscii As Integer)
If KeyAscii = 50 Then
If Ficha.Top < 3360 Then
Ficha.Top = Ficha.Top + 360
Else
KeyAscii = 0
End If
End If
If KeyAscii = 56 Then
If Ficha.Top > 120 Then
Ficha.Top = Ficha.Top - 360
Else
KeyAscii = 0
End If
End If
If KeyAscii = 52 Then
If Ficha.Left > 120 Then
Ficha.Left = Ficha.Left - 360
Else
KeyAscii = 0
End If
End If
If KeyAscii = 54 Then
If Ficha.Left < 3000 Then
Ficha.Left = Ficha.Left + 360
Else
KeyAscii = 0
End If
End If
End Function
Private Sub Ficha2_KeyPress(KeyAscii As Integer)
Call Movimiento2(KeyAscii)
End Sub
Function Movimiento2(KeyAscii As Integer)
If KeyAscii = 50 Then
If Ficha2.Top < 3360 Then
Ficha2.Top = Ficha2.Top + 360
Else
KeyAscii = 0
End If
End If
If KeyAscii = 56 Then
If Ficha2.Top > 120 Then
Ficha2.Top = Ficha2.Top - 360
Else
KeyAscii = 0
End If
End If
If KeyAscii = 52 Then
If Ficha2.Left > 120 Then
Ficha2.Left = Ficha2.Left - 360
Else
KeyAscii = 0
End If
End If
If KeyAscii = 54 Then
If Ficha2.Left < 3000 Then
Ficha2.Left = Ficha2.Left + 360
Else
KeyAscii = 0
End If
End If
End Function
Valora esta pregunta


0