FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour TRichEdit
Posts: 1392
Joined: Mon May 14, 2007 09:49 AM
TRichEdit
Posted: Fri Nov 29, 2013 07:03 AM

Hi all !

I use a class TRichEdit.
How can I get/change the color of selected text ?
How can I get/change the background color of the selected text ?

Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: TRichEdit
Posted: Fri Nov 29, 2013 08:29 AM

Use oRichEdit:Colorize( nStart, nEnd, nColor )

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1392
Joined: Mon May 14, 2007 09:49 AM
Re: TRichEdit
Posted: Fri Nov 29, 2013 08:41 AM
With the help of function Colorize I can to change the text color or background text color ?
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: TRichEdit
Posted: Fri Nov 29, 2013 09:06 AM

No, only the foreground color

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1392
Joined: Mon May 14, 2007 09:49 AM
Re: TRichEdit
Posted: Fri Nov 29, 2013 09:14 AM

thank you.

Where can I find a description of the functions riched20.dll ?

Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: TRichEdit
Posted: Fri Nov 29, 2013 09:16 AM
This seems to be the way to change the background color to the selected text:

http://www.swissdelphicenter.ch/en/showcode.php?id=1438
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 990
Joined: Thu Nov 17, 2005 05:49 PM
Re: TRichEdit
Posted: Sat Nov 30, 2013 12:48 PM

Natter,

To change background color checkout ReSetHighlight(). Below is sample code where I'm using it. ReSetHighlight() automatically changes the background color only on the selected rich text region.

//------------------------------------------------------------------------------------------------------------------------------
METHOD RTFHighlight() CLASS PATHTRANS
LOCAL nClrHigh := ReGetHighlight( ::oActive:hWnd )
LOCAL nClrBack := ChooseColor( nClrHigh )

if !( nClrHigh == nClrBack )
ReSetHighLight( ::oActive:hWnd, nClrBack )
::oActive:lChanged := .T.
endif

RETURN NIL

Reinaldo.

Posts: 1392
Joined: Mon May 14, 2007 09:49 AM
Re: TRichEdit
Posted: Sun Dec 01, 2013 11:56 AM

Thank you Reinaldo !

Posts: 1392
Joined: Mon May 14, 2007 09:49 AM
Re: TRichEdit
Posted: Mon Dec 02, 2013 09:31 AM

Why object TRichEdit not working correctly on the window type "DIALOG" ?
If you place this object type window "WINDOW", then everything is fine

Continue the discussion