Archive

Posts Tagged ‘horizontalscrollpolicy’

Disable Scrollbars in Flex Containers

January 23rd, 2011 No comments

If you create a container component in your Flex application and then create a child of the container which size is bigger than its parent, scrollbars will appear on the bottom and the right sides of the container. If you want to disable the appearance of the scrollbars you should use the verticalScrollPolicy property for the vertical scroll bar and the horizontalScrollPolicy for the the scroll bar shown on the bottom side of your container. When set to “off” these properties will hide the scrollbars. In the following code example we will create a VBox component in which we will add a button. The button component will have a little bit bigger size than its parent. By default, Flex will add scroll bars but we will prevent this functionality.


<mx:VBox id="myVBox"
verticalScrollPolicy="off" horizontalScrollPolicy="off"
width="200"
height="200">
<mx:Button id="myButton"
label="My Button"
width="210" height="210"/>
</mx:VBox>