Set Menu style for disabled color : Menu « Components « Flex






Set Menu style for disabled color

Set Menu style for disabled color
      
<?xml version="1.0"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" xmlns="*">
    <mx:Script>
        
        import mx.controls.Menu;
        public var productMenu:Menu;
        public function initMenu(): void
        {
            productMenu = Menu.createMenu(null, Products.Department);
            productMenu.setStyle("disabledColor", 0xCC3366);
            productMenu.show(10,10);
        }
      
    </mx:Script>
    <mx:Model id="Products">
        <Root>
            <Department label="A">
                <children label="A1" />
                <children label="A2" />
                <children label="A3" />
            </Department>
            <Department label="B">
                <children label="C">
                    <children label="C1" />
                    <children label="C2" enabled="false" />
                </children>
            </Department>
        </Root>
    </mx:Model>
    <mx:Button label="Show menu" click="initMenu()" />
</mx:Application>

   
    
    
    
    
    
  








Related examples in the same category

1.Add icons to menuAdd icons to menu
2.Add submenu to submenuAdd submenu to submenu
3.Show menuShow menu
4.Define properties and reference in actionscriptDefine properties and reference in actionscript
5.Set menu to toggle menu itemSet menu to toggle menu item
6.Radio button menu itemsRadio button menu items
7.Using a nested array to drive a menu
8.CheckBox MenuItemCheckBox MenuItem
9.Creating a model that a menu uses to drive its display
10.Creating a menu from scratchCreating a menu from scratch
11.Compact way to initialize and display the menu all at onceCompact way to initialize and display the menu all at once
12.Show Menu at positioinShow Menu at positioin
13.Disable a menu itemDisable a menu item
14.Model for MenuModel for Menu
15.Add click listener to MenuAdd click listener to Menu
16.Submenu and radio button menuSubmenu and radio button menu
17.CheckBox menuCheckBox menu
18.Menu Control style settingMenu Control style setting
19.Adding icon to MenuitemAdding icon to Menuitem
20.Get clicked menu item index, label, toggle stateGet clicked menu item index, label, toggle state
21.Menu item click handlerMenu item click handler
22.Put Menu, TextInput and Button to ControlBarContentPut Menu, TextInput and Button to ControlBarContent
23.Creating a simple Menu controlCreating a simple Menu control