红绿灯问题终于解决
本帖最后由 杰克 于 2012-3-1 23:24 编辑用了几天,学会一个小小的问题,解决心头疑难,开心呀,呵呵
procedure TForm1.Button1Click(Sender: TObject);
var
a:Boolean;
begin
a:= true;
if shape1.Visible= a then
begin
shape1.Visible:=not a;
shape2.visible:= a ;
end
else if shape1.Visible=not a then
begin
shape1.Visible:=a;
shape2.Visible:=not a;
end;
end;
end.
http://ww1.sinaimg.cn/large/8db42c20gw1dqkbr9w09oj.jpg
或者这样也行:
procedure TForm1.Button1Click(Sender: TObject);
var
a:boolean;
b:boolean;
begin
a:=true;
b:=false;
if shape1.visible=b then
begin
shape1.visible:= a;
shape2.Visible:= b;
end
else
begin
shape2.visible:=a;
shape1.Visible:=b;
end;
end;
end. 呵呵 {:5_110:} 抢沙发了,,,, 恭喜*^O^*
oyz 支持楼主发扬Delphi 凉凉
页:
[1]