Tip on LinkBar control in Flex

LinkBar control defines the style name “linkButtonStyleName” to specify styles for link buttons, but does not define a style name for a selected link button.For example if you want to apply a specific style for a selected link button in the row of link buttons, you would think for a while, make some try outs, look in to the code, scratch your head for a while,curse flex and may be finnally give up.The real thing is it isn’t defined.But there is a way.

LinkBar control defines a row of LinkButtons, meaning we can access and apply styles to any of these individual Buttons at run time using setStyle method.

Example: Button(lnkBr.getChildAt(0)).setStyle(“fontWeight”,”normal”);

In the above line lnkBr is id of the LinkBar and getChildAt method gets that particular button and then we can apply style to that button using the setStyle method.

Demo

Code

 

Advertisements

2 Responses to Tip on LinkBar control in Flex

  1. F says:

    Thanks very usefull.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: