Hilfe!
-
Wie kann ich es bewerkstelligen das beim Tastendruck der Eingabetaste sich der Focus aufs nächste steuerelement setzt? Hab schon auch FAQ durchgesucht aber nichts gefunden.
Danke im voraus
-
Hallo.
Die Funktion PreTranslateMessage wird bei jedem Tastendruck ausgeführt, soweit ich weiß.
Müßtest Dir in dieser Funktion eine Reihe von abfragen machen und dem entsprchend den Focus setzen. Geht bestimmt auch einfacher, weiß aber nicht wie.
Abfrge Beispiel: CWnd* pWnd = GetFocus ();
if (pWnd->GetDlgCtrlID () == IDC_??)Cu
Oli
-
Hallo !
Damit bekommst du das nächste/vorhergehende Steuerelement:
CWnd::GetNextDlgGroupItem CWnd* GetNextDlgGroupItem( CWnd* pWndCtl, BOOL bPrevious = FALSE ) const; Return Value: Pointer to the previous (or next) control in the group if the member function is successful.
oder auch
CWnd::GetNextDlgTabItem CWnd* GetNextDlgTabItem( CWnd* pWndCtl, BOOL bPrevious = FALSE ) const; Return Value: Pointer to the previous (or next) control that has the WS_TABSTOP style, if the member function is successful.
Das in OnOk() abfragen und dann SetFocus() auf das neue Steuerelement. Habe ich nicht ausprobiert, könnte aber klappen...
Tschüss