Adding And Removing Background Color During Printing Follow
I'm trying to add background color to a field when Text is detected, and remove when no data is detected. I can use:
(Format.Objects("Text 13").TextBackgroundColor = BtColor.black) to add the background color to the field, The problem I have is removing that when no test is present in that field.
3 comments
All you'd need to do is use TextBackgroundColor - BtColor.white to get it back to the white background if the data isn't detected.
Problem still there when printing the label. I’m loading this script via the following
- File
- Label Format option
- OnNewRecord (VB Scripting)
- Entering the following:
- Format.Objects("Text 13").TextBackgroundColor - BtColor.White
- Format.Objects("Text 13").TextBackgroundColor - BtColor.White
As I stated before, it will add the background when text is detected, but will not remove when no text is detected.
All what you would need to do is to verify if the value of the text object in question is empty:
If Format.Objects("Text 13").value = "" Then
...
Else ....
End If
You will find a full reference on this on BarTender's Help (F1 key within BarTender) by accessing the "Visual Basic Scripting > Scripting Objects > Object Reference > Object Object" topic.
Please sign in to leave a comment.