CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4

Thread: CEdit woes

  1. #1
    Join Date
    Apr 1999
    Location
    Beaverton, OR
    Posts
    241

    CEdit woes

    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?


  2. #2
    Guest

    Re: CEdit woes

    do you have call to Enable3DControls() in InitInstance?


  3. #3
    Join Date
    Apr 1999
    Location
    Beaverton, OR
    Posts
    241

    Re: CEdit woes

    Yes, Enable3DControls is being called. I traced through the MFC code, and the function does get called. I just don't get it!!


  4. #4
    Join Date
    Aug 1999
    Posts
    13

    Re: CEdit woes

    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.



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured