Sign in to follow this  
Followers 0
step887

gui richedit

1 post in this topic

Is there a way to enter the actually rich text code into richtextbox?

If I use append,set, insert to put in \pard, in the actual RTF it comes out \\pard

I can use stream to var, string replace what I want and then stream from var, but that is not working quite right.

before:

{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fnil\fcharset0 MS Shell Dlg;}}

{\*\generator Msftedit 5.41.21.2509;}\viewkind4\uc1\pard\f0\fs17\par

}

I replaced \pard\ with "\pard\sl360\slmult1\"

after: it is adding an extra par.

{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fnil\fcharset0 MS Shell Dlg;}}

{\*\generator Msftedit 5.41.21.2509;}\viewkind4\uc1\pard\sl360\slmult1\f0\fs17\par

\pard\fs17\par

}

code below

#include <guirichedit.au3>
$GUI =  GUICreate("")
$rt = _GUICtrlRichEdit_Create($GUI,"",0,0)
$i = GUICtrlCreateedit("",0,200)
$btn = GUICtrlCreateButton("Ok", 225,225, 60, 20)
GUISetState()
$VAR1 = _GUICtrlRichEdit_StreamToVar($rt)
$var = StringReplace($var1,"\pard\","\pard\sl360\slmult1\")
_GUICtrlRichEdit_StreamToFile($rt, @DesktopDir & "\gcre.rtf")
MsgBox(0,"","")
_GUICtrlRichEdit_StreamFromVar($RT, $VAR)
_GUICtrlRichEdit_StreamToFile($rt, @DesktopDir & "\gcre.rtf")
_GUICtrlRichEdit_SetText($rt,"")
while 1
switch GUIGetMsg()
  Case $btn
   _GUICtrlRichEdit_AppendText($rt, @crlf & GUICtrlRead($i))
   GUICtrlSetData($i,"")
   _GUICtrlRichEdit_StreamToFile($rt, @DesktopDir & "\gcre.rtf")
  Case -3
   Exit
EndSwitch
WEnd
_GUICtrlRichEdit_Destroy($rt)

Share this post


Link to post
Share on other sites



Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0