how to change richedit selection color hi all help me pleas uses Richedit; how to change richedit selection color select is black, i need blue like Tmemo br |
SelStart := GetTextLen; SelAttributes.Size := 10; //add one unformatted line SelText := 'test1' + #13#10; //add some normal font text //SelText := 'Formatted lines in RichEdit' + #13#10; SelText := 'test2'; ///SelAttributes.Size := 10; //add bold + red SelAttributes.Style := [fsBold]; SelAttributes.Color := clRed; SelText := ':'; SelAttributes.Style := [fsBold]; SelAttributes.Color := clBlue; SelText := 'test2'; //only bold SelAttributes.Color := clGreen; SelText := 'test3:'; /////////// //add italic + blue SelAttributes.Style := [fsbold]; SelAttributes.Color := clpurple; SelText := 'test4'; //new line SelText := #13#10; //add normal again SelAttributes.Style := [fsItalic]; SelAttributes.Size := 10; SelAttributes.Color := cllime; SelText := ''; neXt time USE GOOGLE BEFORE MAKING LAZY THREAD LIKE THIS |
procedure TForm1.Button1Click(Sender: TObject); BEGIN with richEdit1 do begin Richedit1.clear; SelStart := GetTextLen; SelAttributes.Size := 10; //add one unformatted line SelText := 'MY NAME IS DARWIN' + #13#10; //add some normal font text /////SelText := 'LAZY TEAM' + #13#10; SelText := 'DARWIN' + #13#10; //bigger text ///SelAttributes.Size := 10; //add bold + red SelAttributes.Style := [fsBold]; SelAttributes.Color := clRed; SelText := 'DARMILES'; SelAttributes.Style := [fsBold]; SelAttributes.Color := clBlue; SelText := ''+ #13#10; //only bold SelAttributes.Color := clGreen; SelText := 'LEVEL5TEAM'; /////////// //add italic + blue SelAttributes.Style := [fsbold]; SelAttributes.Color := clpurple; SelText := 'GSMHOSTING'; //new line SelText := #13#10; //add normal again SelAttributes.Style := [fsItalic]; SelAttributes.Size := 10; SelAttributes.Color := cllime; SelText := ''; SelAttributes.Size := 10; SelAttributes.Style := [fsItalic]; SelAttributes.Color := clBlue; SelText := ''#13#10; SelText :=''; richedit1.lines.add(' '); SelAttributes.Size := 10; SelAttributes.Style := [fsbold]; SelAttributes.Color := clfuchsia; SelText := 'TEST1'#13#10; end; end; procedure TForm1.BitBtn1Click(Sender: TObject); begin with richEdit1 do begin Richedit1.clear; SelStart := GetTextLen; SelAttributes.Size := 10; //add one unformatted line SelText := 'MY NAME IS DARWIN' + #13#10; //add some normal font text /////SelText := 'LAZY TEAM' + #13#10; SelText := 'DARWIN' + #13#10; //bigger text ///SelAttributes.Size := 10; //add bold + red SelAttributes.Style := [fsBold]; SelAttributes.Color := clRed; SelText := 'DARMILES'; SelAttributes.Style := [fsBold]; SelAttributes.Color := clBlue; SelText := ''+ #13#10; //only bold SelAttributes.Color := clGreen; SelText := 'LEVEL5TEAM'; /////////// //add italic + blue SelAttributes.Style := [fsbold]; SelAttributes.Color := clpurple; SelText := 'GSMHOSTING'; //new line SelText := #13#10; //add normal again SelAttributes.Style := [fsItalic]; SelAttributes.Size := 10; SelAttributes.Color := cllime; SelText := ''; SelAttributes.Size := 10; SelAttributes.Style := [fsItalic]; SelAttributes.Color := clBlue; SelText := ''#13#10; SelText :=''; richedit1.lines.add(' '); SelAttributes.Size := 10; SelAttributes.Style := [fsbold]; SelAttributes.Color := clfuchsia; SelText := 'TEST1'#13#10; end; end; end. |
edited my message :) :) |
Quote:
Thanks darmiles hehe :D :D :D:D:D |
Quote:
This Procedure will Show [time] < clhighlight + String(s) < Color |
All times are GMT +1. The time now is 09:07. |
vBulletin Optimisation provided by
vB Optimise (Pro) -
vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
- GSM Hosting Ltd. - 1999-2023 -