2楼代码改一下
For Each c As Winform.Control In e.Form.Controls
If c.Name.StartsWith("组织") AndAlso c.BackColor <> Color.White Then
Dim clr As Color = c.BackColor
Dim c1 As String = "#" & Format(clr.R,"X2") & Format(clr.G,"X2") & Format(clr.B,"X2")
Dim c2 As String =c.Name.SubString(2,5)
Dim c3 As String =c2 & "," & c1
s=s & "|" & c3
End If
Next
窗口afterload
Dim s As String = Tables("表A").Current("组织图")
For Each s1 As String In s.Split("|")
Dim ar() As String = s1.Split(",")
e.Form.controls("组织" & ar(0)).BackColor = System.Drawing.ColorTranslator.FromHtml(ar(1))
Next