آموزش ساخت کلیدهای میانبر با 2 کاراکتر معمولی کیبورد

48 بار بازدید - 9 ماه پیش - در این آموزش با استفاده
در این آموزش با استفاده از یک آرایه که 2 عنصر داره کلیدها گرفته می شه و رویداد مورد نظر بعد از گرفتن 2 کاراکتر از کلیدهای کیبورد اجرا می شه ... Dim ShortcutKey(1) As Windows.Forms.Keys Event CustomShortcutKeyPressed(firstKey As Keys, secondKey As Keys) Private Sub Form1_KeyDown(sender As Object, e As KeyEventArgs) Handles Me.KeyDown If (Not ShortcutKey(0) = Nothing) Then If ShortcutKey(1) = Nothing Then ShortcutKey(1) = e.KeyCode End If End If If ShortcutKey(0) = Nothing Then ShortcutKey(0) = e.KeyCode End If End Sub Private Sub Form1_KeyUp(sender As Object, e As KeyEventArgs) Handles Me.KeyUp If (Not ShortcutKey(0) = Nothing) AndAlso (Not ShortcutKey(1) = Nothing) Then RaiseEvent CustomShortcutKeyPressed(ShortcutKey(0), ShortcutKey(1)) ShortcutKey(0) = Nothing ShortcutKey(1) = Nothing End If End Sub Private Sub Form1_CustomShortcutKeyPressed(firstKey As Keys, secondKey As Keys) Handles Me.CustomShortcutKeyPressed Debug.Print(" >> {0}{1}", Chr(firstKey), Chr(secondKey)) Select Case (Chr(firstKey) + Chr(secondKey)).ToUpper Case "9M" Dim FRM As New Form FRM.ShowDialog(Me) End Select End Sub
9 ماه پیش در تاریخ 1402/07/15 منتشر شده است.
48 بـار بازدید شده
... بیشتر