Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Inserting RTF code to show up as RTF formatted text in RichEdit Field
#2
Function dialog_rich_edit_RTF_string
Code:
Copy      Help
str dd=
;BEGIN DIALOG
;0 "" 0x90C80AC8 0x0 0 0 224 136 "Dialog"
;3 RichEdit20A 0x54233044 0x200 8 8 208 104 ""
;4 Button 0x54032000 0x0 8 116 48 14 "Test"
;1 Button 0x54030001 0x4 116 116 48 14 "OK"
;2 Button 0x54030000 0x4 168 116 48 14 "Cancel"
;END DIALOG
;DIALOG EDITOR: "" 0x2040700 "*" "" "" ""

str controls = "3"
str re3
if(!ShowDialog(dd &sub.DlgProc &controls)) ret


#sub DlgProc
function# hDlg message wParam lParam

sel message
,case WM_INITDIALOG
,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case 4 goto gTest
ret 1

;gTest
str rtf=
;{\rtf1 \ansi \deff0 {\fonttbl {\f0 Monotype Corsiva;}} \qc \f0 \fs120 \i \b Hello,\line World!}

SETTEXTEX t
SendMessageW(id(3 hDlg) EM_SETTEXTEX &t rtf)


Messages In This Thread
RE: Inserting RTF code to show up as RTF formatted text in RichEdit Field - by Gintaras - 03-23-2018, 05:41 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)