2010年5月17日

VB程式設計歷程

草稿心智圖










程式碼(修改完+離開鍵)

Private Sub Form_KeyPress(KeyAscii As Integer)
With ball
If KeyAscii = 119 Then
Shape35.Top = Shape35.Top - 30 'w = 119
ElseIf KeyAscii = 97 Then
Shape35.Left = Shape35.Left - 30 'a = 97
ElseIf KeyAscii = 115 Then
Shape35.Top = Shape35.Top + 30 's = 115
ElseIf KeyAscii = 100 Then
Shape35.Left = Shape35.Left + 30 'd = 100

ElseIf KeyAscii = 27 Then (<- 離開鍵程式碼p.s要打在這裡)
Shape35.Visible = False

End If
End With

End Sub
配合ascll查按鍵 MVB6.0

會移動的球(執行圖)














小小的橘子=0=





修改後心智圖








增修了移動鍵,記憶體大小