B4J Question Border and Corner Radius

Firpas

Active Member
Licensed User
Longtime User
How to get/set Border Width and Corner Radius of pane by code??

Thanks in advance
 

inakigarm

Well-Known Member
Licensed User
Longtime User
Use CSSUtils code module (from Erel) and for example:

B4X:
CSSUtils.SetStyleProperty(Pane1,"-fx-border-radius","30")
    CSSUtils.SetStyleProperty(Pane1,"-fx-border-width","10")

If you set radius and width as a variable (or to a Slider value), you can change this values easily

Hint: Link for CSS Values (Oracle) & CSS values (simple)

You can change the CSS Style directly from code but CSSUtils preserve all the CSS properties that node has.
 
Last edited:
Upvote 0

rwblinn

Well-Known Member
Licensed User
Longtime User
Also note that in the latest version of B4J, CSSUtils is provided as a library.
Select CSSUtils from the B4J IDE > Tab Libraries Manager. With that, no code module required.
 
Upvote 0
Top