注册 登录
编程论坛 Delphi论坛

求助一下 变颜色的问题

无欢 发布于 2006-04-18 19:46, 524 次点击
我在button1 的按钮上设置颜色 比如 edit1.color :=clred 这样的话一次就变一个颜色

请问 怎么能多变.... 还有 谁有 delphi 的语句 都什么意思的 哪有可以给我一份吗
4 回复
#2
ysp_19842006-04-18 23:05
button1不能设置颜色 。你可以使用bitbtn。
#3
无欢2006-04-19 09:45
不是啊 我是在 edit1 上设置颜色 button1 只是一个按妞
我用的 if edit1.color = clred then
edit1.color:=clBackground
else edit1.color :=clred
这个 if 语句 只能循环 一次 我想一直叫他循环 变色 这个只能2个色来回变
我想要更多的
#4
无欢2006-04-24 09:21
我这问题还没解决 顶上去
#5
ysp_19842006-04-24 09:37

当然了,你用的button1的click事件 单击按钮只能执行一次
你可以用Timer控件
每隔一定的时间响应一次.
procedure Tform1.Timer1timer(sender:Tobject);
begin
if edit1.color = clred then
edit1.color:=clBackground
else if edit1.color =clBackground then
edit1.color:=clred;


end;

1