|
-
April 22nd, 1999, 11:48 AM
#1
CEdit::ReplaceSel
I have created a MFC app which has a CEditView. I am able to GetSelectedText which has been selected and modify this text to add to it. Now that I have retrieved the selected text and modified the text I need to return this text to the selection. I have tried using the ReplaceSel( string, FALSE ) and the compiler says that ReplaceSel is an undeclared identifer. This is what I have so far.
void CMyEditView::OnBold()
{
CString strResult;
GetSelectedText( strResult );
strResult = "<bold>" + strResult + "<bold>";
ReplaceSelected( strResult, FALSE );
}
When the user clicks my Bold menu opion after they have selected a block of text I grab the selected text and add the two html tags <bold> to the front and back end. Now I need to return this into the selected text. I would appriciate any help anyone could give me. Thanks.
Todd Casey
[email protected]
-
April 22nd, 1999, 11:58 AM
#2
Re: CEdit::ReplaceSel
CEditView does not have a ReplaceSel method.
Use the CEditView::GetEditCtrl() method which returns a reference to a CEdit (edit control) then call CEdit::ReplaceSel(). Like this:
GetEditCtrl().ReplaceSelected( strResult, FALSE );
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|