# Syntax/Format for Premade Border Options?

**URL:** <https://forum.inductiveautomation.com/t/syntax-format-for-premade-border-options/79860>\
**Category:** Ignition\
**Tags:** vision, scripting, ignition80\
**Created:** [September 29, 2023, 5:42pm UTC](https://forum.inductiveautomation.com/t/syntax-format-for-premade-border-options/79860 "2023-09-29T17:42:31Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mason\_Stevens](https://avatars.discourse-cdn.com/v4/letter/m/edb3f5/32.png) [@Mason\_Stevens](https://forum.inductiveautomation.com/u/Mason_Stevens)\
**Post date:** [September 29, 2023, 5:42pm UTC](https://forum.inductiveautomation.com/t/syntax-format-for-premade-border-options/79860/1 "2023-09-29T17:42:31Z")

</div>

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:

```auto
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!

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [September 29, 2023, 5:51pm UTC](https://forum.inductiveautomation.com/t/syntax-format-for-premade-border-options/79860/2 "2023-09-29T17:51:08Z")

</div>

Option 1:  
Within the expression you've already got, use the `toBorder` expression function, documented here:  
[https://docs.inductiveautomation.com/display/DOC81/toBorder](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](https://docs.inductiveautomation.com/display/DOC81/Vision+Component+Customizers#VisionComponentCustomizers-StyleCustomizer)

---

<div class="post-metadata">

**Author:** ![Mason\_Stevens](https://avatars.discourse-cdn.com/v4/letter/m/edb3f5/32.png) [@Mason\_Stevens](https://forum.inductiveautomation.com/u/Mason_Stevens)\
**Post date:** [September 29, 2023, 5:53pm UTC](https://forum.inductiveautomation.com/t/syntax-format-for-premade-border-options/79860/3 "2023-09-29T17:53:55Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Mason\_Stevens](https://avatars.discourse-cdn.com/v4/letter/m/edb3f5/32.png) [@Mason\_Stevens](https://forum.inductiveautomation.com/u/Mason_Stevens)\
**Post date:** [September 29, 2023, 6:05pm UTC](https://forum.inductiveautomation.com/t/syntax-format-for-premade-border-options/79860/4 "2023-09-29T18:05:18Z")

</div>

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.
