以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- 如何遍历并赋值颜色 (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=149483) |
-- 作者:rogen -- 发布时间:2020/5/4 9:26:00 -- 如何遍历并赋值颜色 一个简单案例,界面有4个标签控件,想遍历颜色数组后将颜色赋值 以下代码无效,请指正 Dim Cos() As String = {"red","blue","green","white"} For i As Integer = 0 To cos.Length -1 e.Form.Controls("Label" & i+1).ForeColor = "Color." & cos(i) Next |
-- 作者:有点酸 -- 发布时间:2020/5/4 9:44:00 -- Dim clrs() As Color = {Color.red, Color.blue,Color.green,Color.white} For i As Integer = 0 To cos.Length -1 e.Form.Controls("Label" & i+1).ForeColor = clrs(i) Next |