![]() |
Colors in ComboBox
Hi,
wenn ich den folgenden Code verwende, vertauscht mir mein Prog immer die Farben versteht ihr den Fehler?
Delphi-Quellcode:
Der Rest vom Prog funzt schon, nur noch das eine Problem.
function TForm1.CurrText: TTextAttributes;
begin if edit.SelLength > 0 then Result := edit.SelAttributes else Result := edit.DefAttributes; end; function TForm1.GetColor(idx: Integer): TColor; begin case idx of 0 : result := clBlack; 1 : result := clMaroon; 2 : result := clGreen; 3 : result := clOlive; 4 : result := clNavy; 5 : result := clPurple; 6 : result := clGray; 7 : result := clSilver; 8 : result := clRed; 9 : result := clLime; 10 : result := clYellow; 11 : result := clFuchsia; 12 : result := clAqua; 13 : result := clWhite; 14 : result := clScrollBar; 15 : result := clBackground; end; end; // ComboBox procedure TForm1.ColorChange(Sender: TObject); begin CurrText.Color := CurrText.Color + getcolor(Color.ItemIndex); end; |
Re: Colors in ComboBox
Was verstehst du unter vertauschen?
Hier
Delphi-Quellcode:
ddierst du ja zur aktuellen Farbe, die selektierte, wenn mich nicht alles täuscht.
CurrText.Color := CurrText.Color + getcolor(Color.ItemIndex);
|
Re: Colors in ComboBox
:oops:
thx! |
Alle Zeitangaben in WEZ +1. Es ist jetzt 11:05 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz