Flex Rule Control


 

Flex Rule Control

In this example we have illustrate what is Rule control and how many type of Rule controls in flex.

In this example we have illustrate what is Rule control and how many type of Rule controls in flex.

Rule in Flex:-

What is Rule in flex?. The answer is that if user want to create a line between two controls by using Rule control in flex. It is two types, first is VRule and second is HRule. VRule is use when user want to create single vertical line. If user want to single horizontal line between controls by using HRule. You can use VRule by using <mx:VRule>tag if you can use HRule by using <mx:HRule>tag. You can also set the property for these Rule controls.

Example for VRule:-

<?xml version="1.0"?>

<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical">

<mx:Panel width="250" height="200" title="VRule Example" horizontalAlign="center">

<mx:HBox>

<mx:Label text="HRule Left Area"/>

<mx:VRule shadowColor="yellow" strokeColor="red" strokeWidth="2"/>

<mx:Label text="HRule Right Area"/>

</mx:HBox>

</mx:Panel>

</mx:Application>

In this example you can see how to create a VRule in flex and how to set the property for that controls in flex.

Output:- 

In this example three properties are set one is shadowColor that is used to set the shadow color for these components. and second is strokeColor to set the stock color for the Rule components and third property strockWidth is set the width of the Rule and but default strockWidth is 2. 

Example for HRule:-

<?xml version="1.0"?>

<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical">

<mx:Panel width="200" height="200" title="HRule Example" horizontalAlign="center">

<mx:VBox>

<mx:Label text="HRule Upper Area"/>

<mx:HRule shadowColor="yellow" strokeColor="red" strokeWidth="2"/>

<mx:Label text="HRule Lower Area"/>

</mx:VBox>

</mx:Panel>

</mx:Application>

In this example user can see how two create HRule in flex application.

Output:-

0

Ads