Delphi7设置复选框 帮我看看出了什么问题老是出现[Error] Unit1.pas(32): Record, object or class t 谢谢
unitUnit1;interfaceusesWindows,Messages,SysUtils,Variants,Classes,Graphics,Controls,F...
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
chk1: TCheckBox;
chk2: TCheckBox;
chk3: TCheckBox;
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.FormCreate(Sender: TObject);
var
CheckBox1,CheckBox2 :Boolean;
begin
CheckBox1.AllowGrayed :=true;
CheckBox2.State :=cbChecked;
end;
end. 展开
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
chk1: TCheckBox;
chk2: TCheckBox;
chk3: TCheckBox;
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.FormCreate(Sender: TObject);
var
CheckBox1,CheckBox2 :Boolean;
begin
CheckBox1.AllowGrayed :=true;
CheckBox2.State :=cbChecked;
end;
end. 展开
2个回答
展开全部
CheckBox1,CheckBox2 :Boolean
你把CheckBox1和CheckBox2声明为两个Boolean类型的变量了啊。。。。Boolean怎么会有state和AllowGrayed呢
你把CheckBox1和CheckBox2声明为两个Boolean类型的变量了啊。。。。Boolean怎么会有state和AllowGrayed呢
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
可以把
CheckBox1,CheckBox2 :Boolean;
改为
CheckBox1,CheckBox2 :TCheckBox;
然后再创建这两个对象
CheckBox1:= TCheckBox.Create(Self);
CheckBox2:= TCheckBox.Create(Self);
再进行
CheckBox1.AllowGrayed :=true;
CheckBox2.State :=cbChecked;
就可以了
CheckBox1,CheckBox2 :Boolean;
改为
CheckBox1,CheckBox2 :TCheckBox;
然后再创建这两个对象
CheckBox1:= TCheckBox.Create(Self);
CheckBox2:= TCheckBox.Create(Self);
再进行
CheckBox1.AllowGrayed :=true;
CheckBox2.State :=cbChecked;
就可以了
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询