Thema: Delphi runden Button

Einzelnen Beitrag anzeigen

Benutzerbild von arbu man
arbu man

Registriert seit: 3. Nov 2004
Ort: Krefeld
1.108 Beiträge
 
Delphi 7 Professional
 
#2

Re: runden Button

  Alt 4. Dez 2004, 13:43
ja

Delphi-Quellcode:
begin
  x := (Width - Canvas.TextWidth(Caption)) div 2;
  y := (Height- Canvas.TextHeight(Caption)) div 2;
  if Pressed then
    for i := 1 to 3 do
    begin
      // Canvas.Pen.Color := OColor[4-i];
      Canvas.Pen.Color := OColor[(i+1) div 2];
      Canvas.Arc (i, i, Width-i, Height-i, i, i, i, i);
      Canvas.Ellipse (3, 3, Width-3, Height-3);
      Canvas.TextOut (x+1,y+1, Caption+' ');
    end
  else
    for i := 1 to 3 do
    begin
      Canvas.Pen.Color := OColor[i];
      Canvas.Arc (i, i, Width-i, Height-i, i, i, i, i);
      Canvas.Ellipse (3, 3, Width-3, Height-3);
      Canvas.TextOut (x,y, Caption+' ');
    end;
end;
Benutze die Klasse TCustomControl für die komponente
Björn
>> http://bsnx.net <<
Virtual DP Stammtisch v1.0"iw" am 19.09.2007 - ich war dabei!
  Mit Zitat antworten Zitat