kolorowy prycisk

0

czy można zrobić żeby tbutton mógł być czerwony

0

to proste TButton nie może zmieniać kolory poszukaj innego komponentu [lol]

0

to proste TButton nie może zmieniać kolory poszukaj innego komponentu [lol]

Jesteś pewien ? :P Kiedyś kiedy miałem ograniczony dostęp do internetu zapisywałem sobie co ciekawsze artykuły i znalazłem teraz cos takiego:

var 
c : Tcanvas; 
kolor_buttona : TColor; 
kolor_3d_left : Tcolor; 
kolor_3d_top : TColor; 
capt : Tlabel; 
left, top : integer; 
begin 
capt := TLabel.create(self); 
capt.Parent := nil; 
//to zmienia kolor buttona :] 
kolor_buttona := clblue; 
kolor_3d_left := clred; 
kolor_3d_top := cllime; 
c:=TCanvas.Create; 
c.Handle:=GetDC(button1.Handle); 
c.Brush.Color := kolor_buttona; 
c.pen.Color := kolor_buttona; 
c.Rectangle(1,1,button1.width - 1,button1.height - 2); 
c.MoveTo(0,0); 
c.Pen.color := kolor_3d_left; 
c.lineto(button1.width,0); 
c.MoveTo(0,0); 
c.lineto(0,button1.height - 1); 
c.pen.color := kolor_3d_top; 
c.moveto(0,button1.height); 
c.lineto(button1.width,button1.height); 
c.moveto(button1.width,button1.height); // <-- tak dla pewnosci 
c.lineto(button1.width,1); 
c.pen.color := clbtnshadow; 
c.moveto(button1.width - 2,1); 
c.lineto(button1.width - 2,button1.height - 2); 
c.moveto(button1.width - 2,button1.height - 2); //-||- 
c.lineto(2,button1.height - 2); 
//ale gdzie jest caption? - to juz za chwile :] 
capt.font := button1.Font; 
capt.Caption := button1.caption; 
left := (button1.width - capt.width) div 2; 
top := (button1.height - capt.height) div 2; 
c.TextOut(left,top,button1.caption); 
capt.free; 
c.free; 
end; 

Najprawdopodobniej pochodzi to własnie w 4p, ale nie wiem czy jest jeszcze dostępne w sewisie :).

0

A sprawdzales ten kod?

1 użytkowników online, w tym zalogowanych: 0, gości: 1