Setting the button corner radius in a Flex ButtonBar control

The following example shows how you can set the corner radius on a ButtonBar control in Flex by setting the buttonStyleName and cornerRadius styles.

<?xml version="1.0" encoding="utf-8"?>
<!-- -->
<mx:Application name="ButtonBar_buttonStyleName_cornerRadius_test"
        .myCustomButtonStyleName {
            cornerRadius: 16;
    <mx:Array id="arr">
        <mx:Object label="Button" />
        <mx:Object label="ButtonBar" />
        <mx:Object label="CheckBox" />
        <mx:Object label="ColorPicker" />
    <mx:ButtonBar id="buttonBar"
            height="32" />

View source is enabled in the following example.

If you want to set the buttonStyleName style using an external .CSS file or <mx:Style /> block, you can use code similar to the following snippet:

    ButtonBar {
        buttonStyleName: myCustomButtonStyleName;
    .myCustomButtonStyleName {
        cornerRadius: 16;

3 thoughts on “Setting the button corner radius in a Flex ButtonBar control

  1. How do you set the middle buttons to have rounded corners. the buttonStyleName : cornerRadius does not affect the middle buttons. Help!

Comments are closed.