以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  关于Button  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=151218)

--  作者:ygg8310
--  发布时间:2020/6/18 10:36:00
--  关于Button
例如ABCD为4个逻辑列,Button1-10分别对应表的1-10行
如果 第一行 ADCD均为 false 则 Button1 颜色为red
如果 第二行 ADCD均为 false 则 Button2 颜色为red
如果 第三行 ADCD均为 false 则 Button3 颜色为red
这种代码应该怎么个写法?

--  作者:有点蓝
--  发布时间:2020/6/18 10:51:00
--  
di r as row = tables(xxx).rows(0)
if r("A") = false andalso r("B") = false andalso..... then
e.form.controls("Button1").ForeColor = color.red
end if

--  作者:ygg8310
--  发布时间:2020/6/18 11:31:00
--  
这个是写在哪个事件里面?
--  作者:有点蓝
--  发布时间:2020/6/18 12:08:00
--  
想在什么时候改按钮颜色就放在那里,比如窗口afterload
--  作者:ygg8310
--  发布时间:2020/6/18 16:20:00
--  
老师还问一下,这个有什么简单点的写法没?比如我设置了10个Button,那我得要写10个呀
--  作者:有点蓝
--  发布时间:2020/6/18 16:30:00
--  
for i as integer = 1 to 10
dim r as row = tables(xxx).rows(i)
if r("A") = false andalso r("B") = false andalso..... then
e.form.controls("Button" & i).ForeColor = color.red
end if
end if