Solved

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

Posted on 2002-07-23
1
251 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
1 Comment
 
LVL 8

Accepted Solution

by:
fl0yd earned 100 total points
Comment Utility
multiple post -- please put continue to this link:

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

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

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…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
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.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

772 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

10 Experts available now in Live!

Get 1:1 Help Now