Preventing the movement of caret or focus
-
HI..Need Help! I created a edit box subclassed by CWnd, not by CEdit. I did this for custom UI handling. It works well.. But I need the control not to lose the focus anytime.. Even another button contol clicked.. I tried to remove the code in CCmdTarget but it doesn't work well...How can I do this? Any Suggestion appreciated.. Regards..Bajy
-
HI..Need Help! I created a edit box subclassed by CWnd, not by CEdit. I did this for custom UI handling. It works well.. But I need the control not to lose the focus anytime.. Even another button contol clicked.. I tried to remove the code in CCmdTarget but it doesn't work well...How can I do this? Any Suggestion appreciated.. Regards..Bajy
Hello! Include a handler for WM_KILLFOCUS message in your CWnd derived class that you use for subclassing edit box. in this handler you have to call SetFocus function to gain focus back to the control. Alternatively you can handle EN_KILLFOCUS notification in the edit box' parent window. In the handler for the notification you have to do the same - set focus back to the edit box using SetFocus() function. Regards, Andrei Zenkovitch Dundas Software