Solved

Edit control selection

Posted on 2000-04-28
5
197 Views
Last Modified: 2013-11-20
How can I get the text that I select in a multi-line edit control to scroll into view.
I'm using SetSel

Cheers
0
Comment
Question by:TSMITH
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
5 Comments
 
LVL 4

Accepted Solution

by:
captainkirk earned 50 total points
ID: 2759323
I would suspect that if you know the starting character index, you would call LineFromChar() to get the line number and then call LineScroll() to position you to where you want...
0
 
LVL 1

Expert Comment

by:poohbear_68
ID: 2762497
m_MyEdit1.SendMessage(EM_SCROLLCARET);

This should do what you want.
0
 
LVL 1

Expert Comment

by:poohbear_68
ID: 2769240
Maybe I crazy, or just a little weird, but don't both of these two options do the same thing?
0
 

Author Comment

by:TSMITH
ID: 2772394
Yes, they do. Thanks poohbear 68, but I had to award the points to captainkirk as his/her comment was submitted first. Also captainkirk's solution is MFC rather than SDK.
0
 
LVL 1

Expert Comment

by:poohbear_68
ID: 2773195
Right.  No problem -- I fully understand.  So while we're at it anyhow, here's another way to do it!  :)  At least according to documentation, it works.   I guess I haven't tested it specifically.  <grin>

m_Edit.SetSel(m_Edit.GetSel(), FALSE);
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

724 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question