Gruppe
Dialog
Problem
Wie kann ich verhindern, daß der Focus nach Klick auf einen Frame ein Textfeld verläßt und auf den Frame gesetzt wird? Der Frame darf nicht auf ENABLE = FALSE gesetzt werden.
ClassModule: frmFocus
Private Sub cmdWeiter_Click()
Unload Me
End Sub
Private Sub Frame1_MouseDown(ByVal Button As Integer, _
ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
If Frame1.Tag = "" Then
txtFirst.SetFocus
Else
Controls(Frame1.Tag).SetFocus
End If
End Sub
Private Sub Label1_MouseDown(ByVal Button As Integer, _
ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
If Frame1.Tag = "" Then
txtFirst.SetFocus
Else
Controls(Frame1.Tag).SetFocus
End If
End Sub
Private Sub txtFirst_Exit(ByVal Cancel As MSForms.ReturnBoolean)
Frame1.Tag = txtSecond.Name
End Sub
Private Sub txtSecond_Exit(ByVal Cancel As MSForms.ReturnBoolean)
Frame1.Tag = txtThird.Name
End Sub
Private Sub txtThird_Exit(ByVal Cancel As MSForms.ReturnBoolean)
Frame1.Tag = txtFirst.Name
End Sub
Private Sub txtFirst_MouseUp(ByVal Button As Integer, _
ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
Frame1.Tag = txtFirst.Name
End Sub
Private Sub txtSecond_MouseUp(ByVal Button As Integer, _
ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
Frame1.Tag = txtSecond.Name
End Sub
Private Sub txtThird_MouseUp(ByVal Button As Integer, _
ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
Frame1.Tag = txtThird.Name
End Sub
StandardModule: basMain
Sub CallForm()
frmFocus.Show
End Sub