Xbasic
RTF.REPLACE_TEXT Function
Syntax
.REPLACE_TEXT( New_Text as C )
Arguments
- New_Text
New text to paste into the control.
Description
The .REPLACE_TEXT() method replaces the currently selected text with New_Text.
Example
dim crtf.object as P dim crtf.text as C dim new_text as C dim temp as C crtf.object = rtf.create(" ") crtf.object.insert("RTF Text to stretch over one line, so you can see what full justify does", 1) crtf.text = crtf.object.rtf_text ui_dlg_box("Xdialog Sample", <<%dlg% {rtf=30,10crtf}; {lf}; Text [.5new_text]; ; ; %dlg%,<<%code% if a_dlg_button="Replace" then a_dlg_button = "" crtf.object.replace_text(new_text) end if if a_dlg_button="Insert_Text" then a_dlg_button = "" crtf.object.insert_text(new_text) end if crtf.text = crtf.object.rtf_text %code%)
Limitations
Desktop applications only.
See Also