请问一下动态增加的记录窗口怎么设置背景颜色?
以下这段代码 对存在的记录窗口是可以的 通过代码新增的 就报错了
''''''''锁定列 必填列涂色
'Dim g = Forms(e.Form.Name).Controls(jls).basecontrol
'g.Styles.normal.Border.Style = 3
'g.styles.Normal.Border.Color = Color.Black
'g.styles.Normal.Border.width = 3
'Dim Multi As String =dr("锁定列")
'If Multi> "" Then
'Dim Values() As String
'Values = Multi.split("|")
'For idx As Integer = 0 To Values.Length - 1
'Tables("合同").Cols( Values(idx) ).AllowEdit =False
'g.GetCellStyle( Tables("合同").Cols( Values(idx) ).Index ,1).BackColor = Color.Gainsboro
'Next
'End If
'Dim btl As String =dr("必填字段")
'If btl> "" Then
'Dim jcbts() As String = btl.split("|")
'For Index As Integer = 0 To jcbts.Length - 1
'g.GetCellStyle( Tables(e.Form.Name).Cols( jcbts(Index) ).Index ,1).BackColor = Color.pink
'Next
'End If
''''''''锁定列 必填列涂色
[此贴子已经被作者于2019/6/1 15:03:59编辑过]