programing入門
■ このスレッドは過去ログ倉庫に格納されています
0299ヒッキー@プログラミング
NGNGPrivate Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long
Private Type POINTAPI
x As Long
y As Long
End Type
Dim speed As Double
Private Sub Timer1_Timer()
Static OldPos As POINTAPI
Dim CursorPos As POINTAPI
GetCursorPos CursorPos
If OldPos.y > CursorPos.y Then
If speed > 0 Then speed = speed - 0.3
ElseIf OldPos.y < CursorPos.y Then
speed = speed + 0.3
End If
Command1.Top = Command1.Top + speed
OldPos = CursorPos
End Sub
-------------------------------------------
画面に、タイマーとコマンドボタンを1個ずつ貼ってください
■ このスレッドは過去ログ倉庫に格納されています