Solved

Edit control selection

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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
VBA "SendKeys" Syntax for Multiple Keystrokes 7 98
twoTwo  challenge 35 86
sumHeights  challenge 17 61
unix example issues 18 49
Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
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.
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

758 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

19 Experts available now in Live!

Get 1:1 Help Now