A type selector for Button controls : Button Style « Components « Flex






A type selector for Button controls

A type selector for Button controls
       

<!--
Code from Flex 4 Documentation "Using Adobe Flex 4".

This user guide is licensed for use under the terms of the Creative Commons Attribution 
Non-Commercial 3.0 License. 

This License allows users to copy, distribute, and transmit the user guide for noncommercial 
purposes only so long as 
  (1) proper attribution to Adobe is given as the owner of the user guide; and 
  (2) any reuse or distribution of the user guide contains a notice that use of the user guide is governed by these terms. 
The best way to provide notice is to include the following link. 
To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-sa/3.0/

-->


    <!-- styles/TypeSelector.mxml -->
<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">
    <fx:Style>
        @namespace s "library://ns.adobe.com/flex/spark";
        s|Button {
            fontSize: 15;
            color: #9933FF;
        } 
    </fx:Style>
    <s:VGroup>
        <s:Button id="myButton" label="Click Me" />
        <s:Button id="myButton2" label="Click Me" />
    </s:VGroup>
</s:Application>

   
    
    
    
    
    
    
  








Related examples in the same category

1.Set all Buttons to use the font size 10Set all Buttons to use the font size 10
2.Use @font-face to style ButtonUse @font-face to style Button
3.A type selector named ButtonA type selector named Button
4.Define a type selector named ButtonDefine a type selector named Button
5.Applies both class selectors to buttonApplies both class selectors to button
6.Use a pseudo selector to change the appearance of the button when it is in the up, down, and over statesUse a pseudo selector to change the appearance of the button when it is in the up, down, and over states
7.Define a type selector for Button components, but then overrides the color with an inline definitionDefine a type selector for Button components, but then overrides the color with an inline definition
8.Change style properties for Button control using a compound String to get a reference to the objectChange style properties for Button control using a compound String to get a reference to the object
9.Using Cascading Style Sheets to apply style to ButtonUsing Cascading Style Sheets to apply style to Button
10.Assigning Button to the myFontStyle style classAssigning Button to the myFontStyle style class
11.Apply style properties to the Button, myStyle, and global style namesApply style properties to the Button, myStyle, and global style names
12.Use getStyle() and setStyle() to change the Button's fontSize styleUse getStyle() and setStyle() to change the Button's fontSize style
13.Set Button color with styleSet Button color with style
14.Set a Button control's fontSize property as font-size or fontSize in an declarationSet a Button control's fontSize property as font-size or fontSize in an <mx:Style> declaration
15.Apply the custom style to the second button onlyApply the custom style to the second button only
16.Changes style properties on each Button control using a compound String to get a reference to the objectChanges style properties on each Button control using a compound String to get a reference to the object
17.An inheriting style and a non-inheriting style set on the Button control.An inheriting style and a non-inheriting style set on the Button control.
18.Globally changes the Button control's color style propertyGlobally changes the Button control's color style property
19.Define a new style and apply it to only the myButton controlDefine a new style and apply it to only the myButton control
20.Define a new style myFontStyle and apply that style to a Button component by assigning the Button to the myFontStyle style class:Define a new style myFontStyle and apply that style to a Button component by assigning the Button to the myFontStyle style class:
21.Inheritable style properties for Button and LabelInheritable style properties for Button and Label
22.Applying style properties to the Button, myStyle, and global style namesApplying style properties to the Button, myStyle, and global style names
23.Set the fontSize to 15 and the color to 0x9933FF for myButton instanceSet the fontSize to 15 and the color to 0x9933FF for myButton instance
24.Set the fontSize to 15 and the color to 0x9933FF on only the myButton instanceSet the fontSize to 15 and the color to 0x9933FF on only the myButton instance