Home > Adobe Flex > Disable Scrollbars in Flex Containers

Disable Scrollbars in Flex Containers

January 23rd, 2011 Leave a comment Go to 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>

Liked this tutorial? Share and Enjoy:

  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Reddit
  • blogmarks
  • StumbleUpon
  • Technorati
  • TwitThis
  • Yahoo! Buzz
  • NewsVine
  • Slashdot
  1. No comments yet.
  1. No trackbacks yet.