Share on Google+Share on Google+

VScrollBar in Flex4

Advertisement
The VScrollBar controls is used both in the MX and Spark's component. The VScrollBar control can work as a stand-alone controls, it works combinedly with other compentents as a custom component to provide scrolling functionality.

VScrollBar in Flex4:

The VScrollBar controls is used both in the MX and Spark's component. The VScrollBar control can work as a stand-alone controls, it works combinedly with other compentents as a custom component to provide scrolling functionality. It has four parts: a track, two arrow buttons, and a thumb. The width of this control is equal to the largest width of its subcomponents. The tag of VScrollbar is <s:VScrollbar>.

Example:

<?xml version="1.0" encoding="utf-8"?>

<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"

xmlns:mx="library://ns.adobe.com/flex/mx"

xmlns:s="library://ns.adobe.com/flex/spark">

<s:Panel title="VScrollbar Example" width="167" height="222">

<mx:HBox x="33" y="20" borderStyle="solid">

<s:HGroup>

<s:DataGroup id="item1" left="10" top="20"

clipAndEnableScrolling="true"

itemRenderer="spark.skins.spark.DefaultItemRenderer">

<s:layout>

<s:VerticalLayout requestedRowCount="5"/>

</s:layout>

<s:dataProvider>

<s:ArrayCollection>

<fx:String>Label</fx:String>

<fx:String>TextInput</fx:String>

<fx:String>Button</fx:String>

<fx:String>ButtonBar</fx:String>

<fx:String>ComboBox</fx:String>

<fx:String>CheckBox</fx:String>

<fx:String>RadioButton</fx:String>

<fx:String>Image</fx:String>

</s:ArrayCollection>

</s:dataProvider>

</s:DataGroup>

<s:VScrollBar id="vscroll" viewport="{item1}" height="{item1.height}"/>

</s:HGroup>

</mx:HBox>

</s:Panel>

</s:Application>

In this example you can see how we can use a VScrollBar control in Flex4.

Output:

Running Application:

To view this page ensure that Adobe Flash Player version 10.0.0 or greater is installed.

Download this code

Advertisements

Advertisement

Posted on: May 13, 2010 If you enjoyed this post then why not add us on Google+? Add us to your Circles

Share this Tutorial Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.