How to set focus to dialog controls
-
Hi everybody, i have a dialog with a treectrl and several other controls like combo and listboxes, and i want that if you doubleclick a treenode/item that his related control in the dialog gets the focus. The treenode stores a pointer to his related control. I tried pControl->SetFocus() in the OnDblClk handler but it doesn't work. Need help. TIA, Chris
-
Hi everybody, i have a dialog with a treectrl and several other controls like combo and listboxes, and i want that if you doubleclick a treenode/item that his related control in the dialog gets the focus. The treenode stores a pointer to his related control. I tried pControl->SetFocus() in the OnDblClk handler but it doesn't work. Need help. TIA, Chris
Hi Chris, Its' not clear to understand your need. What I guess was you want to set a focus to child control. Get a window handle of that control using pControl->GetSafeHwnd() which will return HWND, Using this handle get a pointer ot that window using FromHandle(). Use this returned pointer to set the focus of that window. This should work. If not, feel free to mail me. ================== The original message was: Hi everybody,
i have a dialog with a treectrl and several other controls like combo and listboxes,
and i want that if you doubleclick a treenode/item that his related control in the
dialog gets the focus. The treenode stores a pointer to his related control.
I tried pControl->SetFocus() in the OnDblClk handler but it doesn't work.Need help.
TIA, Chris