📄 button.pas
字号:
unit button;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
Button2: TButton;
Button3: TButton;
procedure Button3Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
procedure TForm1.Button3Click(Sender: TObject);
var
x,y,i:integer;
begin
x:=0;
y:=0;
form1.canvas.pen.width:=1;
for i:=0 to 8 do
begin
form1.canvas.pen.color:=$00404040;
form1.canvas.moveto(Button1.left+Button1.width+x,
Button1.top+8);
form1.canvas.lineto(Button1.left+Button1.width+x,
Button1.top+button1.height+8);
form1.canvas.moveto(Button1.left+8,
Button1.top+Button1.height+y);
form1.canvas.lineto(Button1.left+Button1.width+8,
Button1.top+button1.height+y);
x:=x+1;
y:=y+1;
end;
end;
procedure TForm1.Button2Click(Sender: TObject);
var
x,y,i:integer;
begin
x:=0;
y:=0;
form1.canvas.pen.width:=1;
for i:=0 to 8 do
begin
form1.canvas.pen.color:=$00a0a0a0;
form1.canvas.moveto(Button1.left+Button1.width+x,
Button1.top+y);
form1.canvas.lineto(Button1.left+Button1.width+x,
Button1.top+button1.height+y);
form1.canvas.pen.color:=$00606060;
form1.canvas.moveto(Button1.left+x,
Button1.top+Button1.height+y);
form1.canvas.lineto(Button1.left+Button1.width+x,
Button1.top+button1.height+y);
x:=x+1;
y:=y+1;
end;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -