.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

SetBackgroundColor not working rev 2

3 REPLIES 3
Reply
Message 1 of 4
Anonymous
245 Views, 3 Replies

SetBackgroundColor not working rev 2

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}
3 REPLIES 3
Message 2 of 4
Anonymous
in reply to: Anonymous

No clues eh?
Message 3 of 4
Anonymous
in reply to: Anonymous

Try to also call:
SetBackgroundColorNone

after SetBackgroundColor

wrote in message news:6289156@discussion.autodesk.com...
No clues eh?
Message 4 of 4
Anonymous
in reply to: Anonymous

At first, I couldn't see how that would help, but for grins I tried it.
It worked !
Thanks man 🙂

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost