Does anyone know why SetBackgroundColor will not work for me?
Everything else works just fine. Below is a chunk of code (which I hope formats correctly) taken right
out of a "looking glass" article and it does not work either....
I can set the color manually, but not in code.
This is in Acad 2006 BTW
Thanks
Perry
{code}
If sd.Contains(styleName) Then
tsId = sd.GetAt(styleName)
Else
' Otherwise we have to create it
Dim ts As New TableStyle()
' Make the header area red
ts.SetBackgroundColor(Color.FromColorIndex(ColorMethod.ByAci, 1), CInt((RowType.HeaderRow Or RowType.TitleRow)))
' And the data area yellow
ts.SetBackgroundColor(Color.FromColorIndex(ColorMethod.ByAci, 2), CInt(RowType.DataRow))
' With magenta text everywhere (yeuch 🙂
ts.SetColor(Color.FromColorIndex(ColorMethod.ByAci, 6), CInt((RowType.HeaderRow Or RowType.TitleRow Or RowType.DataRow)))
' Add our table style to the dictionary
' and to the transaction
sd.UpgradeOpen()
tsId = sd.SetAt(styleName, ts)
tr.AddNewlyCreatedDBObject(ts, True)
sd.DowngradeOpen()
End If
{code}