![]() |
Re: Einzelne Einträge in einer Combobox verändern
Delphi-Quellcode:
Combox.Items[Index];
|
Re: Einzelne Einträge in einer Combobox verändern
Endlich! Ich habs jetzt verstanden. Je länger ich mich damit beschäftige umso mehr versteh ich es.
Danke für eure Beiträge. |
Re: Einzelne Einträge in einer Combobox verändern
Hi ich habe eine andere Lösung gefunden und zwar hier im Forum.
Ich spreche die Beiträge einfach über einen Case an:
Delphi-Quellcode:
Nun muss ich die Einträge aus der Combobox in der Memobox verändern.
procedure TForm1.ComboBox1DrawItem(Control: TWinControl; Index: Integer;
Rect: TRect; State: TOwnerDrawState); var cb : TComboBox; begin cb := TComboBox(Control); case Index of 0 : begin cb.Canvas.Brush.Color := clWhite; cb.Canvas.FillRect(Rect); cb.Canvas.Font.Color := clBlack; cb.Canvas.Font.Style := [fsBold]; cb.Canvas.TextOut(Rect.Left,Rect.Top,cb.Items[Index]); end; 1 : begin cb.Canvas.Brush.Color := clWhite; cb.Canvas.FillRect(Rect); cb.Canvas.Font.Color := clBlack; cb.Canvas.Font.Style := [fsBold]; cb.Canvas.TextOut(Rect.Left,Rect.Top,cb.Items[Index]); end; 2 : begin cb.Canvas.Brush.Color := clWhite; cb.Canvas.FillRect(Rect); cb.Canvas.Font.Color := clBlack; cb.Canvas.Font.Style := [fsItalic]; cb.Canvas.TextOut(Rect.Left,Rect.Top,cb.Items[Index]); end; end; end; Wie könnte man das realisieren? |
Re: Einzelne Einträge in einer Combobox verändern
Ich habs jetzt:
Delphi-Quellcode:
Ich frage einfach die Zeilen im Memo ab!!! Und führe die Ereignisse in der Case-Anweisung durch.
begin
cb := TComboBox(Control); zeileone := Memo1.lines[0]; zeiletwo := Memo1.lines[1]; zeilethree := Memo1.lines[2]; case Index of 0 : begin cb.Canvas.Brush.Color := clWhite; cb.Canvas.FillRect(Rect); cb.Canvas.Font.Color := clBlack; if zeileone[length(zeileone)] = '1' then cb.Canvas.Font.Style := [fsBold] else if zeileone[length(zeileone)] = '2' then cb.Canvas.Font.Style := [fsItalic] else if zeileone[length(zeileone)] = '3' then cb.Canvas.Font.Style := [fsUnderline] else if zeileone[length(zeileone)] = '4' then cb.Canvas.Font.Style := [fsStrikeOut]; cb.Canvas.TextOut(Rect.Left,Rect.Top,cb.Items[Index]); end; 1 : begin ... :dancer: |
Alle Zeitangaben in WEZ +1. Es ist jetzt 02:19 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