Jumat, 18 Juni 2010
0
[VB] State Mouse Pada Form
Deklarasi:Source Code:
1 Form
Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
Call CetakState(X, Y, Shift, Button)
End Sub
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Call CetakState(X, Y, Shift, Button)
End Sub
Sub CetakState(ByVal X As Single, Y As Single, Shift As Integer, Button As Integer)
Dim Isi As String
Isi = Space(20)
If Button = vbLeftButton Then Mid$(Isi, 1, 1) = "L"
If Button = vbRightButton Then Mid$(Isi, 5, 1) = "R"
If Button = vbMiddleButton Then Mid$(Isi, 3, 1) = "M"
If Shift = vbShiftMask Then Mid$(Isi, 7, 5) = "Shift"
If Shift = vbCtrlMask Then Mid$(Isi, 13, 4) = "Ctrl"
If Shift = vbAltMask Then Mid$(Isi, 18, 3) = "Alt"
Isi = "[" & X & "," & Y & "] " & Isi
Label1.Caption = Isi
End Sub
Private Sub Form_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
Call CetakState(X, Y, Shift, Button)
End Sub
Langganan:
Posting Komentar (Atom)
0 Komentar Untuk “[VB] State Mouse Pada Form”
Posting Komentar
Berikan komentar positif tentang artikel yang sederhana ini niscaya sobat akan mendapatkan balasannya. Hehehe