CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Aug 2010
    Posts
    12

    How to create an edit box in a CView

    I'm trying to create an edit box in a CView.
    So far, this is how far I've gotten:



    With this code

    Code:
    // .h
    CEdit m_MyEditField;
    
    // .c
    m_MyEditField.Create(WS_CHILD | WS_VISIBLE,CRect(40,40,500,Y+55),this,0x1552);
    m_MyEditField.SetWindowText("this is my CEdit field");
    As you can see, the edit box doesn't look like the ones in a dialog, which is what I'm trying to accomplish.
    Is there possibly some other class I should be using for the edit box?
    Or another setting for .Create?

  2. #2
    GCDEF is offline Elite Member Power Poster
    Join Date
    Nov 2003
    Location
    Florida
    Posts
    12,635

    Re: How to create an edit box in a CView

    Sounds like you want a CFormView.

  3. #3
    Join Date
    Feb 2003
    Location
    Iasi - Romania
    Posts
    8,234

    Re: How to create an edit box in a CView

    ...or directly use CEditView class, derived from CView, which contains an edit control itself.
    Also have a look at this FAQ: How to make a simple text editor?
    Ovidiu
    "When in Rome, do as Romans do."
    My latest articles: https://codexpertro.wordpress.com/

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