was ist neu ¦  programmier tips ¦  indy artikel ¦  intraweb artikel ¦  informationen ¦  links ¦  interviews
 sonstiges ¦  tutorials ¦  Add&Win Gewinnspiel

Tips (1541)

Dateien (137)
Datenbanken (90)
Drucken (35)
Grafik (114)
IDE (21)
Indy (5)
Internet / LAN (130)
IntraWeb (0)
Mathematik (76)
Multimedia (45)
Oberfläche (107)
Objekte/
ActiveX (51)

OpenTools API (3)
Sonstiges (126)
Strings (83)
System (266)
VCL (242)

Tips sortiert nach
Komponente


Tip suchen

Tip hinzufügen

Add&Win Gewinnspiel

Werbung

54 Visitors Online


 
...einen Schatten hinter Komponenten erzeugen?
Autor: Sven
Homepage: http://www.svens-fun-page2.de.vu
[ Tip ausdrucken ]  

Tip Bewertung (8):  
     




procedure ShadeIt(f: TForm; c: TControl; Width: Integer; Color: TColor);
var
  
rect: TRect;
  old: TColor;
begin
  if 
(c.Visible) then
  begin
    
rect := c.BoundsRect;
    rect.Left := rect.Left + Width;
    rect.Top := rect.Top + Width;
    rect.Right := rect.Right + Width;
    rect.Bottom := rect.Bottom + Width;
    old := f.Canvas.Brush.Color;
    f.Canvas.Brush.Color := Color;
    f.Canvas.fillrect(rect);
    f.Canvas.Brush.Color := old;
  end;
end;

procedure TForm1.FormPaint(Sender: TObject);
var
  
i: Integer;
begin
  for 
i := 0 to Self.ControlCount - 1 do
    
ShadeIt(Self, Self.Controls[i], 3, clBlack);
end;


 

Bewerten Sie diesen Tipp:

dürftig
ausgezeichnet


Copyright © by SwissDelphiCenter.ch
All trademarks are the sole property of their respective owners