Autor Beitrag
jjturbo
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 516

Win2000 prof., WinXP prof.
D4 Stand., D5 Prof, D7 Prof, D2007 Prof.
BeitragVerfasst: Di 20.01.09 14:50 
Moin Forum,

kann ich irgendwie auf einen TSpeedbutton neben der Caption einen weiteren Text ausgeben?
Ich benötige einen zweiten Text an anderer Position und mit einer anderen Schriftart.

Wenn ich das nur einmal bräuchte würde ich jetzt einfach ein TLabel drüberlegen, aber das geht doch bestimmt eleganter, oder?

Gruß jjturbo

_________________
Windows XP: Für die einen nur ein Betriebssystem - für die anderen der längste Virus der Welt...
jjturbo Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 516

Win2000 prof., WinXP prof.
D4 Stand., D5 Prof, D7 Prof, D2007 Prof.
BeitragVerfasst: Di 20.01.09 15:31 
Habe eine Lösung gefunden:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
procedure TForm1.SpeedButtonsBeschriften(Btn:TSpeedButton;Txt1,Txt2:String;FontSize1,FontSize2:Integer);
var R         :TRect;
    PosX      :Integer;
    PosY      :Integer;
    txtHoehe  :Integer;
    txtBreite :Integer;
begin

  with Btn do begin
    Glyph.Height            := Height;
    Glyph.Width             := Width;
    Glyph.Canvas.Font       := Font;

    Glyph.Canvas.Font.Size  := FontSize1;
    R                       := Bounds(0,0,Glyph.Width,Glyph.Height);
    Glyph.Canvas.TextOut(0,0,Txt1);

    Glyph.Canvas.Font.Size  := FontSize2;
    txtHoehe                := Glyph.Canvas.TextHeight(Txt2);
    txtBreite               := Glyph.Canvas.TextWidth(Txt2);
    PosX                    := R.Right div 2 - txtBreite div 2;
    PosY                    := R.Bottom div 2 - txtHoehe div 2;
    Glyph.Canvas.TextOut(PosX,PosY,Txt2);
  end;

end;

_________________
Windows XP: Für die einen nur ein Betriebssystem - für die anderen der längste Virus der Welt...