TRichEdit

TRichEdit

Postby Natter » Fri Nov 29, 2013 7: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 ?
Natter
 
Posts: 1120
Joined: Mon May 14, 2007 9:49 am

Re: TRichEdit

Postby Antonio Linares » Fri Nov 29, 2013 8:29 am

Use oRichEdit:Colorize( nStart, nEnd, nColor )
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41314
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: TRichEdit

Postby Natter » Fri Nov 29, 2013 8:41 am

With the help of function Colorize I can to change the text color or background text color ?
Natter
 
Posts: 1120
Joined: Mon May 14, 2007 9:49 am

Re: TRichEdit

Postby Antonio Linares » Fri Nov 29, 2013 9:06 am

No, only the foreground color
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41314
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: TRichEdit

Postby Natter » Fri Nov 29, 2013 9:14 am

thank you.

Where can I find a description of the functions riched20.dll ?
Natter
 
Posts: 1120
Joined: Mon May 14, 2007 9:49 am

Re: TRichEdit

Postby Antonio Linares » Fri Nov 29, 2013 9: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
User avatar
Antonio Linares
Site Admin
 
Posts: 41314
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: TRichEdit

Postby reinaldocrespo » 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.
User avatar
reinaldocrespo
 
Posts: 972
Joined: Thu Nov 17, 2005 5:49 pm
Location: Fort Lauderdale, FL

Re: TRichEdit

Postby Natter » Sun Dec 01, 2013 11:56 am

Thank you Reinaldo !
Natter
 
Posts: 1120
Joined: Mon May 14, 2007 9:49 am

Re: TRichEdit

Postby Natter » Mon Dec 02, 2013 9: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
Natter
 
Posts: 1120
Joined: Mon May 14, 2007 9:49 am


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 51 guests