When I press the button Bold, all text gets selected:
Uploaded with ImageShack.us
I don´t want this, just continue editing in same position as I was before I press Bold. This is my code:
- Code: Select all Expand view
- #Include "FiveWin.ch"
//----------------------------------------------------------------------------//
Function Main()
Local oDlg, oRich, cRtf := "test"
Local hRichDLL := LoadLibrary( "riched20.dll" )
local lBold := .F.
cRtf:="{\rtf1\ansi\deff0{\fonttbl{\f0\fnil\fcharset0 Courier New;}}"+CRLF+;
"{\colortbl ;\red0\green77\blue187;\red192\green80\blue77;}"+CRLF+;
"{\*\generator Msftedit 5.41.21.2510;}\viewkind4\uc1\pard\cf1\lang1031\f0\fs22 This is \b colored \b0 text\cf0 . \cf2 The background is color 1 and the foreground is color 2\cf0\par"+CRLF+CRLF+;
"}"
DEFINE DIALOG oDlg NAME "Test"
oRich = TRichEdit():Redefine( 100, { || "" }, oDlg )
oRich:SetText( cRtf )
oDlg:bStart = { || oRich:SetPos( 0 )}
REDEFINE BUTTON ID 120 ACTION ( lBold := !lBold, ;
oRich:SetBold( lBold ), oRich:Setfocus() )
ACTIVATE DIALOG oDlg CENTERED
FreeLibrary( hRichDLL )
Return nil
What is wrong?.
Thank you very much.