Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3213392
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T14:56:21+00:00 2026-05-17T14:56:21+00:00

I have CEdit control and I don’t want any text to be selected by

  • 0

I have CEdit control and I don’t want any text to be selected by default. I tried using

    m_txtURL.SetSel(-1, 0, TRUE);

to remove the selection, but to no avail. can some one suggest a way to do achieve that?

I tried to select some characters using the following coding. That too did not work.

m_txtURL.SetSel(-1, 0, TRUE);

Can someone tell me what the problem could be?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T14:56:22+00:00Added an answer on May 17, 2026 at 2:56 pm

    Now I am able to deselect the text in the Edit control. The edit control, I am using is the first control in the Dialog box, so the by default the first control in the dialog box has been set to focus. From developers’ reference:

    If OnInitDialog returns nonzero,
    Windows sets the input focus to the
    first control in the dialog box. The
    application can return 0 only if it
    has explicitly set the input focus to
    one of the controls in the dialog box.

    No what I have done is:

    BOOL CIegSettingsDlg::OnInitDialog()
    {
        CDialog::OnInitDialog();
    
    
        return FALSE;  // return TRUE unless you set the focus to a control
    }
    

    By this we indicate to dialog box that, we would take care of focussing a control.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a CEdit control that I want to be able to take time
How do I have a CEdit control display placeholder text when it's empty, similar
I have the following segment of code where m_edit is a CEdit control: TCHAR
I have a CEdit text box which is a part of a property pane
I have a CEdit derived control that displays the string N/A when the undelying
I have added a simple Cedit control to my dialog and have an OnEnChangeEdit
I have the following code, m_edit is a MFC CEdit (I know I would
I don't have Apple ID (reviewed), as I don't have credit card. So, for
I have a Credit Card Number in an XML Message and I want to
My application used to use an MFC CEdit control and we had no problems

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.