5,939
社区成员
发帖
与我相关
我的任务
分享
unit Unit1;
interface
uses
。。。。。。;
type
TForm1 = class(TForm)
Edit1: TEdit;
Button1: TButton;
CheckBox1: TCheckBox;
Button2: TButton;
Button3: TButton;
procedure Button2Click(Sender: TObject);
procedure Button3Click(Sender: TObject);
private
{ Private declarations }
procedure aaa(x: array of TWinControl; b: Boolean);
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.aaa(x: array of TWinControl; b: Boolean);
var
i: Integer;
begin
for i := 0 to Length(x) -1 do
x[i].Visible := b;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
aaa([Edit1,Button1,CheckBox1],false);
end;
procedure TForm1.Button3Click(Sender: TObject);
begin
aaa([Edit1,Button1,CheckBox1],true);
end;
end.
procedure aaa(x: array of TWinControl; b: Boolean);
var
i: Integer;
begin
for i := 0 to Length(x) -1 do
begin
x[i].Visible := b;
end;
end;procedure aaa(x: array of TWinControl; b: Boolean);
var
i: Integer;
begin
for i := 0 to Length(x) do
begin
x[i].Visible := b;
end;
end;