|
ベースフォームを作っています。
以下のように実装したらF1押下によってメッセージボックスが開くはずですが、何もイベントが発生しません。
原因がわかる方いますでしょうか?
フォームモジュール
Private Sub Form_Load()
Dim ClsForm As New cls_BaseForm
Set ClsForm.BaseForm = Me.Form
End Sub
クラスモジュール
Private WithEvents cls_BaseForm As Access.Form
Public Property Set BaseForm(ByVal CtlBaseForm As Access.Form)
Set cls_BaseForm = CtlBaseForm
cls_BaseForm.InsideWidth = FORM_WIDTH'定数
cls_BaseForm.InsideHeight = FORM_HEIGHT'定数
cls_BaseForm.Main.BackColor = FORM_COLOR'定数
cls_BaseForm.KeyPreview = True
cls_BaseForm.OnKeyDown = "[Event Procedure]"
End Property
Public Property Get BaseForm() As Form
Set BaseForm = cls_BaseForm
End Property
Private Sub cls_BaseForm_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyF1 Then
MSGBOX "A"
ElseIf KeyCode = vbKeyF2 Then
ElseIf KeyCode = vbKeyF3 Then
ElseIf KeyCode = vbKeyF4 Then
ElseIf KeyCode = vbKeyF5 Then
ElseIf KeyCode = vbKeyF6 Then
ElseIf KeyCode = vbKeyF7 Then
ElseIf KeyCode = vbKeyF8 Then
ElseIf KeyCode = vbKeyF9 Then
ElseIf KeyCode = vbKeyF10 Then
ElseIf KeyCode = vbKeyF11 Then
ElseIf KeyCode = vbKeyF12 Then
End If
End Sub
|
|