?
Solved

Edit control selection

Posted on 2000-04-28
5
Medium Priority
?
200 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 200 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

Moving data to the cloud? Find out if you’re ready

Before moving to the cloud, it is important to carefully define your db needs, plan for the migration & understand prod. environment. This wp explains how to define what you need from a cloud provider, plan for the migration & what putting a cloud solution into practice entails.

Question has a verified solution.

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

Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
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: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …

800 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