AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Sprachen und Entwicklungsumgebungen Sonstige Fragen zu Delphi Delphi Einzelnes Wort eines String in anderer Farbe?
Thema durchsuchen
Ansicht
Themen-Optionen

Einzelnes Wort eines String in anderer Farbe?

Ein Thema von gunfran · begonnen am 28. Sep 2007 · letzter Beitrag vom 30. Sep 2007
Antwort Antwort
Benutzerbild von Matze
Matze
(Co-Admin)

Registriert seit: 7. Jul 2003
Ort: Schwabenländle
14.929 Beiträge
 
Turbo Delphi für Win32
 
#1

Re: Einzelnes Wort eines String in anderer Farbe?

  Alt 28. Sep 2007, 12:08
Hi,

wenn du's ganz schlampig machen möchtest, dann ginge es so (von mir hast du das aber nicht ):

Bastel dir den Dialog selbst mittels neuem Formular und erzeuge darauf dynamisch Labels. DlgForm ist der Name des Formulars. Eine Funktion kannst du dir natürlich selbst daraus basteln:

Delphi-Quellcode:
var
  myLbl1, myLbl2, myLbl3: TLabel;
begin
  // linkes Label
  myLbl1 := TLabel.Create(DlgForm);
  with myLbl1 do
  begin
    Autosize := true;
    Font.Color := clBlack;
    Parent := Form1;
    Top := 30;
    Left := 20;
    Name := 'myLbl1';

    Caption := 'Das Produkt ';
    Show;
  end;

  // mittleres Label
  myLbl2 := TLabel.Create(DlgForm);
  with myLbl2 do
  begin
    Autosize := true;
    Font.Color := clRed;
    Parent := Form1;
    Top := 30;
    Left := 20 + myLbl1.Width;
    Name := 'myLbl2';

    Caption := 'Eierkuchen';
    Show;
  end;

  // rechtes Label
  myLbl3 := TLabel.Create(DlgForm);
  with myLbl3 do
  begin
    Autosize := true;
    Font.Color := clBlack;
    Parent := Form1;
    Top := 30;
    Left := 20 + myLbl1.Width + myLbl2.Width;
    Name := 'myLbl3';

    Caption := ' befindet sich schon im Korb! ';
    Show;
  end;
end;
Eine schönere Möglichkeit wäre, das ganze selbst zu zeichnen.
Edit: Mini-Beispiel im Anhang.
Angehängte Dateien
Dateityp: zip label_428.zip (5,0 KB, 11x aufgerufen)
  Mit Zitat antworten Zitat
Antwort Antwort


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 06:44 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 by Thomas Breitkreuz