I am losing context help when I use m_cEdit.ModifyStyleEx( NULL, WS_TABSTOP);
Posted on 2004-09-13
I have an few edit box on the screen of an MFC dialog and property page. I have to sometimes dynamically make a few controls "readonly" due to business logic. Because of this read only state, it is also required that the control is dynamically remove from the tab sequence. But when I do this, I noticed that the context help is lose. ie when I press the dialog's help button then move the help cursor onto the control and click, no help message pops up.
the code for disable the control is as follows
m_cEdit.ModifyStyleEx( NULL, WS_TABSTOP);
Note: I do not wish to make the control "disable", as the text goes grey, I only wish to make it "readonly"!!
So why is the help lost when I called
m_cEdit.ModifyStyleEx( NULL, WS_TABSTOP); ??
When I comment the above line out, and leave the m_cEdit.SetReadonly(TRUE) the context helps works fine! Also I have a few other controls on the page which I have non-dynamically set the TabStop to be false and SetReadonly to be true, but the context helps works fine on them. it is only when I do it dynamicall that the problem arise.
Another question while i am here, the documentation says ModifyStyle(DWord Remove, DWord Add) but I find that
m_cEdit.ModifyStyleEx( NULL, WS_TABSTOP); removes the tab stop and
m_cEdit.ModifyStyleEx( WS_TABSTOP, NULL); sets it. ??? shouldn't it be the other way around??
Any comments/explanation would be much appreciated.