Syntax/Format for Premade Border Options?

Hey Gurus,

I'm looking to make a really simple binding on a label that will alter its border based on the selection in a dropdown box. I've seen other posts using the Java Swing commands for combining borders, creating complex ones, etc., but this is more than I need. I simply want to toggle between two of the normal preset border types as-is (raised bevel and lowered bevel).

My first approach was to include an expression binding on the label's border property that read something like:

if({Dropdown} = 1, ~lowered bevel border~, ~raised bevel border~)

However, I'm unsure of what formatting/syntax is used within Ignition to reference those two premade borders (i.e., what should I replace "~lowered bevel border~" with to see the results I'd like?). Is there some built-in keywording I could use in a simple if-statement like this, or will I need to dig into the Java Swing commands and maybe set them up in a property change script looking at the dropdown itself?

Any advice on the path of least resistance is greatly appreciated! Thanks!

Option 1:
Within the expression you've already got, use the toBorder expression function, documented here:
https://docs.inductiveautomation.com/display/DOC81/toBorder

Option 2 (generally preferred):
Use the Style Customizer on the component in question to switch between the two borders:
https://docs.inductiveautomation.com/display/DOC81/Vision+Component+Customizers#VisionComponentCustomizers-StyleCustomizer

1 Like

I always forget the style customizer exists haha. Thanks for the help, Paul!

1 Like

For those reading in the future:

I created a custom property on the label that I bound to the selectedValue of the dropdown box. Then, I used this custom property as the Driving Property within the style customizer, and linked different border styles to custom property values as necessary. Works like a charm.

1 Like