CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    May 2009
    Posts
    103

    RichEdit - NOT select text by default

    We are using VC++ v6 and have a control on a form that is a RichEdit. When there is data in the control, and you tab into it, it of course selects and hilights all the text. Is there a way to NOT do that and put the cursor in the first position?

  2. #2
    Join Date
    Apr 2009
    Posts
    598

    Re: RichEdit - NOT select text by default

    Try:
    Code:
    Edit_SetSel(hRTF, 0, 0);

  3. #3
    Join Date
    May 2009
    Posts
    103

    Re: RichEdit - NOT select text by default

    The control is called... m_edit

    I have....

    m_edit.SetSel(0,0)

    as the last line in the OnInitDialog.

    That didn't work. When I tab into it, it still hilights it all.

    Pete

  4. #4
    Join Date
    Apr 2009
    Posts
    598

    Re: RichEdit - NOT select text by default

    Sorry, I don't know MFC.

    OnInitDialog is not the right place because it is not called when you tab into it. Maybe you have onFocus.

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