Click to See Complete Forum and Search --> : CEdit woes


nordyj
August 9th, 1999, 04:22 PM
Hi. This is probably a very simple question, but for one reason or another, the answer has been eluding me. I'm trying to create a CEdit control in an SDI application. I call the CEdit::Create function in the OnInitialUpdate function of the view, with the following window styles:
WS_CHILD
WS_VISIBLE
WS_BORDER
WS_EX_CLIENTEDGE
WS_VSCROLL
ES_MULTILINE
ES_AUTOVSCROLL

When I run the application, it runs, and creates the edit box. The problem, is that the edit box is not 3D. It is simply bordered by a single pixel thick black line. It should look like a standard edit box (like one you would put onto a dialog). Why is this happening?

August 9th, 1999, 04:26 PM
do you have call to Enable3DControls() in InitInstance?

nordyj
August 9th, 1999, 04:44 PM
Yes, Enable3DControls is being called. I traced through the MFC code, and the function does get called. I just don't get it!!

James Armstrong
August 9th, 1999, 07:47 PM
you cannot pass the WS_EX_CLIENTEDGE style to the Create() function as this is an extended style. You need to call CreateEx()

Try:

CWnd * pWnd = (CWnd *)&m_MyEdit;
pWnd->CreateEx(WS_EX_CLIENTEDGE, _T("EDIT"), NULL, WS_CHILD|WS_VISIBLE|WS_VSCROLL|ES_MULTILINE|ES_AUTOVSCROLL, CRect(0,0,100,100), this, YourID);


HTH,

James Armstrong.