Şimdi Sizlere Formda Yöntuşları(Ok Tuşları ön,arka,geri,ileri) ile resim çizmeyi göstericem
Çok Basit Bir Mantık İle Lafı Uzatmadan
Formu açıyoruz ve yapıştırıyoruz
Form Kodu;
Option Explicit
Dim x, y As Single
Private Sub Form_Load()
Show
DrawWidth = 8
x = 50
y = 50
Scale (0, 400)-(600, 0)
PSet (x, y)
End Sub
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyRight Then
x = x + 20
Line -(x, y)
End If
If KeyCode = vbKeyLeft Then
x = x - 20
Line -(x, y)
End If
If KeyCode = vbKeyUp Then
y = y + 20
Line -(x, y)
End If
If KeyCode = vbKeyDown Then
y = y - 20
Line -(x, y)
End If
End Sub
Çok Basit Bir Mantık İle Lafı Uzatmadan
Formu açıyoruz ve yapıştırıyoruz
Form Kodu;
Option Explicit
Dim x, y As Single
Private Sub Form_Load()
Show
DrawWidth = 8
x = 50
y = 50
Scale (0, 400)-(600, 0)
PSet (x, y)
End Sub
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyRight Then
x = x + 20
Line -(x, y)
End If
If KeyCode = vbKeyLeft Then
x = x - 20
Line -(x, y)
End If
If KeyCode = vbKeyUp Then
y = y + 20
Line -(x, y)
End If
If KeyCode = vbKeyDown Then
y = y - 20
Line -(x, y)
End If
End Sub