我现在查了帖子新建了一个表背景批注存放表名行号和背景菜单的帖子颜色选取按钮我参照的代码
Dim tname As String = CurrentTable.Name
Dim hk As Integer = CurrentTable.Current("_Identify")
Dim cname As String = CurrentTable.Cols(CurrentTable.ColSel).Name
Dim dr As DataRow = DataTables("背景批注").Find("表名 = '" & tname & "' and 行号 = " & hk )
If dr Is Nothing Then
dr = DataTables("背景批注").AddNew
dr("表名") = tname
dr("行号") = hk
End If
Dim sColor As String = dr("背景")
Dim Values() As String = sColor.Split("|")
For Index As Integer = 0 To Values.Length - 1
If cname = Values(Index).Split(",")(0) Then
sColor = sColor.replace(Values(Index),"")
Exit For
End If
Next
sColor = sColor.Trim("|") & "|" & cName & "," & e.ColorPicker.Color.Toargb
e.ColorPicker.Color=Color.white
dr("背景") = sColor.Trim("|")
DataTables("背景批注").save
背景批注表里有新增的记录,但是当前表的单元格还是不变色。我下载的例子是可以变的真奇怪了,我看例子的库有内部函数我也照抄了