掲示板システム
ホーム
アクセス解析
カテゴリ
ログアウト
Functionkeyを設定する方法? (ID:79916)
名前
ホームページ(ブログ、Twitterなど)のURL (省略可)
本文
こういうこと? Option Explicit Private Sub PushFKey(pKeyCode As Integer) Select Case pKeyCode Case vbKeyF1 MsgBox "F1 Pushed!!" Case vbKeyF2 MsgBox "F2 Pushed!!" Case Else MsgBox "Any Key Pushed!!" End Select End Sub Private Sub Command1_Click(Index As Integer) Call PushFKey(Index + vbKeyF1) End Sub Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer) Select Case KeyCode Case vbKeyF1, vbKeyF2, vbKeyF3, vbKeyF4, _ vbKeyF5, vbKeyF6, vbKeyF7, vbKeyF8, _ vbKeyF9, vbKeyF10, vbKeyF11, vbKeyF12 Call PushFKey(KeyCode) End Select End Sub Private Sub Form_Load() Dim i As Long Me.KeyPreview = True With Command1(0) .Left = 120 .Top = 120 .Height = 495 .Width = 615 .Caption = "F1" End With For i = 1 To 11 Load Command1(i) With Command1(i) .Left = Command1(i - 1).Left + Command1(i - 1).Width .Caption = "F" & CStr(i + 1) .Visible = True End With Next End Sub
←解決時は質問者本人がここをチェックしてください。
戻る
掲示板システム
Copyright 2020 Takeshi Okamoto All Rights Reserved.