|
> If KeyCode = 13 Then
> MsgBox "ここで処理"
> Else
> Beep
> Exit Sub
> End If
>
あー、えっと、これじゃ、「↓」とか押すと、
フォーカスが次へ移っちゃうんで、
'==============================================
Private Flag As Boolean
Private Sub TextBox1_Exit(ByVal Cancel As MSForms.ReturnBoolean)
If Flag = True Then
Cancel = True
End If
End Sub
Private Sub TextBox1_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
If KeyCode = 13 Then
MsgBox "ここで処理"
Flag = False
Else
Beep
Flag = True
Exit Sub
End If
End Sub
って、したらいいかなあ?
どうでしょう?
|
|