Languages :: Delphi :: RichEdit&selection color |
|||
| By: ginsonic |
Date: 19/07/2003 00:00:00 |
Points: 300 | Status: Answered Quality : Excellent |
|
How can I change the selected text color ? As can be done for combobox or dbgrid . |
|||
| By: VGR | Date: 19/07/2003 06:35:00 | Type : Answer |
|
| http://beta.experts-exchange.com/Programming/Programming_Languages/Delphi/Q_10205638.html | |||
| By: ferhad | Date: 19/07/2003 08:11:00 | Type : Comment |
|
| hi ginsonic Hope the following code will help you RichEdit1.SelAttributes.Color := FontDialog1.Font.Color; Regards Ferhad |
|||
| By: ginsonic | Date: 19/07/2003 15:10:00 | Type : Comment |
|
| VGR , I have already this tip but I don't wish to change the system color. I wish to leave the rest of applications to use default color and just mine to have clRed ( for example ). ferhad, I tested your code but nothing happening. |
|||
| By: esoftbg | Date: 20/07/2003 19:55:00 | Type : Comment |
|
| RichEdit.SelStart := 4; RichEdit.SelLength := 2; RichEdit.SelAttributes.Color := clRed; emil |
|||
| By: ferhad | Date: 21/07/2003 11:23:00 | Type : Comment |
|
| First u should select something in RichEdit than in onclick of button type the following code RichEdit.SelAttributes.Color := clRed it should work |
|||
| By: ginsonic | Date: 22/07/2003 13:40:00 | Type : Comment |
|
| I wish to have this color when I select the text and not to select with black and then to click a button to get a red one :( |
|||
| By: ginsonic | Date: 22/07/2003 13:44:00 | Type : Comment |
|
| BTW, RichEdit.SelAttributes.Color don't change the selection color but the selected text color. |
|||
| By: DragonSlayer | Date: 22/07/2003 15:09:00 | Type : Comment |
|
| I guess you should've said the "highlight colour", ginsonic :) but then, I dunno how to do it without doing a system-wide change either :( |
|||
| By: ginsonic | Date: 23/07/2003 13:58:00 | Type : Comment |
|
| Maybe something alike when the mouse button is down to get the selstart, when move the mouse get the endsel and change the background color and font for selected text. I think that is possible but , for moment I don't know how ( is my first richedit application) and don't have time to study..yet |
|||
|
Do register to be able to answer |
|||
©2010 These pages are served without commercial sponsorship. (No popup ads, etc...). Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE.
Please DO link to this page!








