以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  [求助]面板颜色  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=193976)

--  作者:苏州老街
--  发布时间:2024/10/30 12:05:00
--  [求助]面板颜色
老师好,我想把动态生成的每个面板设置不同的颜色,谢谢老师。

Dim left1 As Integer = 50
Dim txt3 As WinForm.Panel
For i As Integer = 1 To 7                                                                                         
    txt3 = e.Form.CreateControl("数据" & i, ControlTypeEnum.Panel)
    txt3.Left = left1
    txt3.Top = 180
    txt3.width = 80
    txt3.height = 150    
    left1 += 120
    txt3.left = 30 + 112 * (i-1)
    \'txt3.BorderStyle = BorderStyle.Fixed3D
    txt3.Anchor = Windows.Forms.AnchorStyles.Top Or Windows.Forms.AnchorStyles.Bottom                                                                                            
    e.Form.Controls("面板").AddControl(txt3) 
Next


--  作者:有点蓝
--  发布时间:2024/10/30 13:34:00
--  
http://www.foxtable.com/webhelp/topics/0720.htm

Dim txt3 As WinForm.Panel
dim yse() as color = {color.red,coloe.blue,.................}
For i As Integer = 1 To 7                                                                                         
    txt3 = e.Form.CreateControl("数据" & i, ControlTypeEnum.Panel)
txt3.BackColor = yse(i-1)