Autor Beitrag
SpeedyFighter1
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 53



BeitragVerfasst: Sa 10.02.07 19:39 
Huhu,
ich wollte mittels eines Labels einen Satz anzeigen lassen, bei dem ein einzelnes Wort bzw. eine Wortgruppe besonders hervorgehoben wird. (z.B. fett, kursiv, farbig...)
Schon mal Danke im Vorraus!
Mfg SpeedyFighter1
Blawen
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 616
Erhaltene Danke: 33

Win XP, Vista, 7
Delphi 5 Prof., BDS 2006 Prof. RAD Studio XE
BeitragVerfasst: Sa 10.02.07 19:53 
user profile iconSpeedyFighter1 hat folgendes geschrieben:
ich wollte mittels eines Labels einen Satz anzeigen lassen, bei dem ein einzelnes Wort bzw. eine Wortgruppe besonders hervorgehoben wird. (z.B. fett, kursiv, farbig...)
Ist meines Wissens mit einem normalen Label nicht machbar. Nimm doch ganz einfach mehrere Labels

_________________
Es kompilert, wir können ausliefern.
Und es kompiliert wieder - das Update ist fertig - bitte 100 Euro ;-)
mkinzler
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 4106
Erhaltene Danke: 13


Delphi 2010 Pro; Delphi.Prism 2011 pro
BeitragVerfasst: Sa 10.02.07 20:07 
Wäre nun bei einer RTF- oder HTML-fähigem Label möglich.

_________________
Markus Kinzler.
Danniolo
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 693



BeitragVerfasst: Sa 10.02.07 20:37 
Was wäre z.B. hiermit
SpeedyFighter1 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 53



BeitragVerfasst: Sa 10.02.07 21:25 
ok, ich mach es jetzt in einzelnen Labels.
Auf welche Einstellung muss ich denn Align setzen, wenn ich Alignment=taCenter habe, damit der Text des Labels vermittel ist ?
Nur wenn ich Align=alClient setze, ist der Text mittig, jedoch vergrößert sich das Label plötzlich über das ganze Form und ich kann weder top, left ... einstellen.
korny boy
Hält's aus hier
Beiträge: 8

WinXP
Delphi 7 Personal
BeitragVerfasst: So 11.02.07 00:00 
Belass die eigenschaft doch auf AlNone und versuche folgendes...

Label1.Caption:='Test';
Label2.Caption:='pro';
Label3.Caption:='gramm';


Label1.Top:=10;
Label2.Top:=10;
Label3.Top:=10;


Label1.Left:=10;

Label2.Left:=Label1.left + Label1.Width;

Label3.Left:=Label2.Left + Label2.Width;


Aber je nachdem in welchem Umfang du das ganze benutzen willst, wird es vielleicht etwas unpraktisch das so zu machen, aber ist ja vielleicht noch ausbaufähig...

gruß
korny boy
Lannes
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2352
Erhaltene Danke: 4

Win XP, 95, 3.11, IE6
D3 Prof, D4 Standard, D2005 PE, TurboDelphi, Lazarus, D2010
BeitragVerfasst: So 11.02.07 00:26 
Hallo,

ein Richedit kommt auch immer ganz gut weg dabei, vor allem wenn man noch Zeilenumbrüche realisieren möchte, denn dann wirds mit Labels schwierig. :wink:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
RichEdit1.BorderStyle := bsNone;
RichEdit1.ParentColor := True;
RichEdit1.ReadOnly := True;

//......
with Richedit1 do
  begin
  SelAttributes.Color := clRed;
  SelText := 'rot ';
  SelAttributes.Color := clgreen;
  SelText := 'grün ';
  SelAttributes.Color := clBlue;
  SelText := 'blau';
  end;

_________________
MfG Lannes
(Nichts ist nicht Nichts) and ('' <> nil ) and (Pointer('') = nil ) and (@('') <> nil )