Solved

Edit control selection

Posted on 2000-04-28
5
171 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
  • 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
iSeries DB2 Query 2 91
has77  challenge 9 73
FizzBuzz challenge 9 77
Line meaning 9 82
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…
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
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.

863 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

Need Help in Real-Time?

Connect with top rated Experts

28 Experts available now in Live!

Get 1:1 Help Now