W ktoryms poscie ZIOMBER napisal procke do kolorowania buttona :
>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 pewności
>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 już 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;
ale jak mozna zrobic ,aby byl on kolorowany Od razu po starcie aplikacji ?
ta procka wpakowana do: OnShow, OnPaint, OnCreate nie dziala, jedynie pod jakims OnClick :(
--Source of life - Programming,
Skateboarding,
Metal.