?
Solved

How to select and visible mark a region in an edit field

Posted on 2002-07-23
1
Medium Priority
?
295 Views
Last Modified: 2013-11-20
Hi,

i have a big, multipleline Editfield, with it's controll-membervariable m_EditView, and a value-member-variable m_sView. I wanna search for the sting m_sSearch in the editfield and select it. This works fine if i use some actions like copy, paste, delete, but it isn't visible, not white letters on blue background or something else. If the "selected" text is not in a visible range, the edit-field scrolls by itself to the "selected" text.

Here's the "code" :

void CMyDialog::OnButtonSearch()
{
UpdateData();
int Pos = m_sView.Find( m_sSearch );

if( Pos >= 0 )
{
        m_EditView.SetSel( Pos, Pos + m_sSearch.GetLength() );
}
}
0
Comment
Question by:DennisWood
[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
1 Comment
 
LVL 8

Accepted Solution

by:
fl0yd earned 300 total points
ID: 7174344
multiple post -- please put continue to this link:

http://www.experts-exchange.com/mfc/Q_20327076.html
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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…
This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
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.
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
Suggested Courses

762 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