// Falls Sie ein
Fenster ohne Rand nutzen
(BorderStyle =
bsNone), können
Sie
type TForm1 = class(TForm) Button1: TButton; procedure Button1Click(Sender: TObject); procedure FormPaint(Sender: TObject); procedure FormCreate(Sender: TObject); private { Private-Deklarationen } public procedure border(Licht, Schatten: TColor; Innenrand: boolean; Breite: byte); end; var Form1: TForm1; implementation {$R *.DFM} procedure TForm1.FormCreate(Sender: TObject); begin borderstyle := bsnone; end; procedure TForm1.border (Licht, Schatten: TColor; Innenrand: boolean; Breite: byte); procedure go(bv: boolean; i: integer); var x, xpi, pcw, pch: integer; begin pcw := pred(ClientWidth); pch := pred(ClientHeight); with canvas do begin if bv then pen.color := Licht else pen.color := Schatten; for x := 0 to pred(Breite) do begin xpi := x + i; moveto(pcw - xpi, xpi); lineto(xpi, xpi); lineto(xpi, pch - xpi); end; if bv then pen.color := Schatten else pen.color := Licht; for x := 0 to pred(Breite) do begin xpi := x + i; moveto(pcw - xpi, xpi); lineto(pcw - xpi, pch - xpi); lineto(pred(xpi), pch - xpi); end; end; end; begin go(true, 0); if Innenrand then go(false, Breite); end; procedure TForm1.FormPaint(Sender: TObject); begin border($C0C0C0, clgray, true, 2); // border($CCCCCC, clgray, false, 5); end; procedure TForm1.Button1Click(Sender: TObject); begin close; end; |
Zugriffe seit 6.9.2001 auf Delphi-Ecke