怎样给button添加一个属性如count,当click一下时count:=true,第二下count:=fasle 怎样给button添加一个属性如count,当click一下时count:=true,第二下count:=fasle第三下时count:=true;怎么做?? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 继承TBUTTON,注意COUNT应该为BOOL类型 添加属性的话得改控件,不方便。你可以利用Tag属性来实现:procedure TForm1.Button1Click(Sender: TObject);begin if Button1.Tag = 0 then Button1.Tag := 1 else Button1.Tag := 0;end; i定义为全局变量。初值付为0procedure TForm1.Button1Click(Sender: TObject);begin if i= 0 thenbegin count:=true i:= 1end elsebegin count:=fasle i:= 0;endend; 直接定义全局变量count=false ,procedure TForm1.Button1Click(Sender: TObject);begin if count count = false else count = true;end; sysu(死树),如果要添加属性,怎么做,举个例子?谢谢! 一般showhint用不到,可以利用这一属性.只要hint就行. private count:boolean;....procedure TForm1.Button1Click(Sender: TObject);begin count:= not count; //更简单end; tnewbutton = class(tbutton)count:boolean;... delphi XE2 下spcomm的问题 delphi6,7的帮助文件在win7系统下不能用? ReadDirectoryChanges的详细用法及说明????? 在BHO编程中得到网页的源代码后,修改源代码后,如何使浏览器继续调用修改完的代码 在线等待 [北京]诚聘Delphi程序员 很问各位大侠,Delphi的Web功能很强大,但是页面美化功能总觉得有限 一个关于oracle的insert问题? 怎样建客户机服务器模式数据库应用程序 incompatible types………… 也要问Delphi与Excel连接 奇怪的问题 dsgnintf.pas是个什么东西。什么地方有的down.
procedure TForm1.Button1Click(Sender: TObject);
begin
if Button1.Tag = 0 then
Button1.Tag := 1
else
Button1.Tag := 0;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
if i= 0 then
begin
count:=true
i:= 1
end
else
begin
count:=fasle
i:= 0;
end
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
if count
count = false
else
count = true;
end;
count:boolean;
....
procedure TForm1.Button1Click(Sender: TObject);
begin
count:= not count; //更简单
end;
count:boolean;
...