Solved

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

Posted on 2002-07-23
1
277 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
ID: 7174344
multiple post -- please put continue to this link:

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

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
function returning CString in a regular win32 DLL 8 190
centeredAverage challenge 8 181
only14 challenge 19 82
haveThree challenge 22 122
In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
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.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

808 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