Delphi-PRAXiS
Seite 2 von 2     12   

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   GUI-Design mit VCL / FireMonkey / Common Controls (https://www.delphipraxis.net/18-gui-design-mit-vcl-firemonkey-common-controls/)
-   -   Delphi Einzelne Einträge in einer Combobox verändern (https://www.delphipraxis.net/53055-einzelne-eintraege-einer-combobox-veraendern.html)

Kroko1999 12. Sep 2005 10:13

Re: Einzelne Einträge in einer Combobox verändern
 
Delphi-Quellcode:
Combox.Items[Index];

mase1908 12. Sep 2005 11:29

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.

mase1908 12. Sep 2005 13:27

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:
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;
Nun muss ich die Einträge aus der Combobox in der Memobox verändern.

Wie könnte man das realisieren?

mase1908 12. Sep 2005 15:02

Re: Einzelne Einträge in einer Combobox verändern
 
Ich habs jetzt:
Delphi-Quellcode:
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
      ...
Ich frage einfach die Zeilen im Memo ab!!! Und führe die Ereignisse in der Case-Anweisung durch.
:dancer:


Alle Zeitangaben in WEZ +1. Es ist jetzt 02:19 Uhr.
Seite 2 von 2     12   

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