 |
|
การสร้างระบบ Hotkey shortcut ด้วย VB ช่วยหน่อยค่ะ |
|
 |
|
|
 |
 |
|
Code (VB.NET)
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
' When the form loads, the KeyPreview property is set to True.
' This lets the form capture keyboard events before
' any other element in the form.
Me.KeyPreview = True
End Sub
Private Sub Form1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles MyBase.KeyDown
If e.Alt And e.KeyCode.ToString = "F" Then
' When the user presses both the 'ALT' key and 'F' key,
' KeyPreview is set to False, and a message appears.
' This message is only displayed when KeyPreview is set to True.
Me.KeyPreview = False
MsgBox("KeyPreview is True, and this is from the FORM.")
End If
End Sub
Private Sub TextBox1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles TextBox1.KeyDown
If e.Alt And e.KeyCode.ToString = "F" Then
' When the user presses both the 'Alt key and the 'F' key,
' KeyPreview is set to True, and a message appears.
' This message is only displayed when KeyPreview is set to False.
Me.KeyPreview = True
MsgBox("KeyPreview is False, and this is from the CONTROL")
End If
End Sub
เป็นการดักจับตัว Keyword
|
 |
 |
 |
 |
Date :
2013-11-04 05:55:02 |
By :
mr.win |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ขอบคุณค่ะ
นำไปประยุกใช้แล้ว ยังไม่สำเร็จ 100% เนื่องจาก code ไม่ตอบรับ และ สนองอัตโนมัติ กับ การกดปุ่ม 2ปุ่ม เช่น กด Shift+F
ในฟอร์มรับ ค่าปุ่ม ที่จะส่งบันทึกเข้าฐานข้อมูล ไม่ ทำงานตามที่ ต้องการค่ะ
ไว้จะพยายามต่อไป พี่ๆคนไหน มีคำแนะนำเพิ่มเติม ช่วยหน่อยนะคะ
|
 |
 |
 |
 |
Date :
2013-11-11 16:11:43 |
By :
guezt |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ไม่ทำงานเพราะอะไร
handle ผิด control เปล่า
|
 |
 |
 |
 |
Date :
2013-11-11 16:21:25 |
By :
ห้ามตอบเกินวันละ 2 กระทู้ |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|