Dynamic CEdit
-
I am trying to create a CEdit dynamically, and placing it in a CPropertyPage. What I end up with is a CEdit with what I think is the large system font, and no 3D border. Here's how I'm creating it (I used the same settings as other CEdit's not created dynamically):
m_pOctalEdit->Create(WS_CHILD|WS_VISIBLE|WS_TABSTOP|ES_AUTOHSCROLL|ES_NUMBER,rect, GetParent(),OCTAL_EDIT); m_pOctalEdit->ModifyStyleEx(0,WS_EX_CLIENTEDGE | WS_EX_NOPARENTNOTIFY);
Any idea why the 3D border is not there, and the font is different? Thank you for your help. -
I am trying to create a CEdit dynamically, and placing it in a CPropertyPage. What I end up with is a CEdit with what I think is the large system font, and no 3D border. Here's how I'm creating it (I used the same settings as other CEdit's not created dynamically):
m_pOctalEdit->Create(WS_CHILD|WS_VISIBLE|WS_TABSTOP|ES_AUTOHSCROLL|ES_NUMBER,rect, GetParent(),OCTAL_EDIT); m_pOctalEdit->ModifyStyleEx(0,WS_EX_CLIENTEDGE | WS_EX_NOPARENTNOTIFY);
Any idea why the 3D border is not there, and the font is different? Thank you for your help.m_pOctalEdit->Create(WS_CHILD|WS_VISIBLE|WS_TABSTOP|ES_AUTOHSCROLL|ES_NUMBER,rect, GetParent(), OCTAL_EDIT); 1. What's that? Whose parent shoud be a parent of your editbox? 2. Use ModifyStyleEx(0, WS_EX_CLIENTEDGE | WS_EX_NOPARENTNOTIFY, SWP_DRAWFRAME | SWP_NOMOVE | SWP_NOSIZE | SWP_SHOWWINDOW); and remove WS_VISIBLE style from Create. 3. I think that the much better approach is to create edit control with CreateEx, so you can specify extended window styles upon creation. 4. To show a correct font - get parent's font and set it to the control window.
-
m_pOctalEdit->Create(WS_CHILD|WS_VISIBLE|WS_TABSTOP|ES_AUTOHSCROLL|ES_NUMBER,rect, GetParent(), OCTAL_EDIT); 1. What's that? Whose parent shoud be a parent of your editbox? 2. Use ModifyStyleEx(0, WS_EX_CLIENTEDGE | WS_EX_NOPARENTNOTIFY, SWP_DRAWFRAME | SWP_NOMOVE | SWP_NOSIZE | SWP_SHOWWINDOW); and remove WS_VISIBLE style from Create. 3. I think that the much better approach is to create edit control with CreateEx, so you can specify extended window styles upon creation. 4. To show a correct font - get parent's font and set it to the control window.
-
Thank you for the reply. It looks like the SWP_DRAWFRAME is waht I was missing. To answer your question, the GetParent() will return the CPropertyPage (as mentioned in the initial posting). Thanks again, Dave
Regarding to GetParent, in member of what class are you calling to CEdit::Create?
-
Regarding to GetParent, in member of what class are you calling to CEdit::Create?