avoiding focus to read only edit control
-
In a dialog, some edit controls become read only / normal at runtime based on some conditions. When the edit is read only, I want to avoid focus to control. When tab pressed I want to set focus to next editable control. On Mouse click, focus should be in previous control only. To do this what message should I handle? I have DDXed edit controls to customized CEdit derived class. Thanks
-- "Programming is an art that fights back!"
-
In a dialog, some edit controls become read only / normal at runtime based on some conditions. When the edit is read only, I want to avoid focus to control. When tab pressed I want to set focus to next editable control. On Mouse click, focus should be in previous control only. To do this what message should I handle? I have DDXed edit controls to customized CEdit derived class. Thanks
-- "Programming is an art that fights back!"
In Style of CEdit, u have Tab Stop. please uncheck Tab stop. :)
Величие Бога не может быть недооценена.
-
In a dialog, some edit controls become read only / normal at runtime based on some conditions. When the edit is read only, I want to avoid focus to control. When tab pressed I want to set focus to next editable control. On Mouse click, focus should be in previous control only. To do this what message should I handle? I have DDXed edit controls to customized CEdit derived class. Thanks
-- "Programming is an art that fights back!"
You have to remove the
WS_TABSTOP
style at runtime. You could do this at the same time you're making the control read only. Use CWnd::ModifyStyle[^] likeedit.ModifyStyle(WS_TABSTOP, 0);
«_Superman_» I love work. It gives me something to do between weekends.
-
You have to remove the
WS_TABSTOP
style at runtime. You could do this at the same time you're making the control read only. Use CWnd::ModifyStyle[^] likeedit.ModifyStyle(WS_TABSTOP, 0);
«_Superman_» I love work. It gives me something to do between weekends.
It better to do tab stop at run time than doing statically. Initially we can set the tab stop to 0 using the resource, but runtime changing is more useful as superman suggested. Full 5 for the answer :)
Величие Бога не может быть недооценена.