以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.net/bbs/index.asp)
--  专家坐堂  (http://foxtable.net/bbs/list.asp?boardid=2)
----  动态控件颜色赋值  (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=190659)

--  作者:yifan3429
--  发布时间:2024/2/27 19:49:00
--  动态控件颜色赋值
For Each c As Winform.Control In e.Form.Controls
    Dim Value1 As String = "Color.LightSkyBlue|Color.DarkTurquoise|Color.DarkCyan|Color.MediumTurquoise|Color.MediumAquamarine|Color.Olive|Color.DarkKhaki|Color.Orange|Color.FireBrick"
    Dim sps1() As Char = {"|"}
    Dim Names1() As String = Value1.Split(sps1)
    For Each Name1 As String In Names1
        c.BackColor = Name1 
        \'        Output.Show(Name1)
    Next
Next

---------------------------
错误
---------------------------
编译错误:类型“String”的值无法转换为“System.Drawing.Color”。



错误代码:c.BackColor = Name1
---------------------------
确定   
---------------------------


--  作者:有点蓝
--  发布时间:2024/2/27 20:41:00
--  
http://foxtable.com/bbs/dispbbs.asp?boardid=2&Id=151712