zoukankan      html  css  js  c++  java
  • Setting the background color and background alpha on a Flex PopUpButton control’s pop up menu

    The following example shows how you can change the background color and alpha of a PopUpButton control’s pop up menu in Flex by setting the popUpStyleName, backgroundAlpha, and backgroundColor styles.
    <?xml version="1.0"?>
    <!-- http://blog.flexexamples.com/2008/01/17/setting-the-background-color-and-background-alpha-on-a-flex-popupbutton-controls-pop-up-menu/ -->
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
            layout
    ="vertical"
            verticalAlign
    ="top"
            backgroundColor
    ="white">

        
    <mx:Script>
            
    <![CDATA[
                import mx.controls.Menu;
                import mx.events.MenuEvent;

                [Bindable]
                private var menu:Menu;

                private function initMenu():void {
                    menu = new Menu();
                    menu.dataProvider = arr;
                    menu.setStyle("themeColor", "black");
                }
            
    ]]>
        
    </mx:Script>

        
    <mx:Array id="arr">
            
    <mx:Object label="Button" />
            
    <mx:Object label="ButtonBar" />
            
    <mx:Object label="ColorPicker" />
            
    <mx:Object label="ComboBox" />
        
    </mx:Array>

        
    <mx:Style>
            .myPop {
                backgroundAlpha: 0.7;
                backgroundColor: black;
                borderStyle: none;
                color: white;
            }
        
    </mx:Style>

        
    <mx:ApplicationControlBar dock="true">
            
    <mx:PopUpButton id="popUpButton"
                    label
    ="Select a control"
                    popUp
    ="{menu}"
                    popUpStyleName
    ="myPop"
                    preinitialize
    ="initMenu();" />
        
    </mx:ApplicationControlBar>

        
    <mx:VBox backgroundColor="haloSilver"
                width
    ="100%"
                height
    ="100%" />

    </mx:Application>

  • 相关阅读:
    【转】理清基本的git(github)流程
    GIT CHEAT SHEET
    failed to push some refs to 'git@github.com:*/learngit.git'
    catch(…) vs catch(CException *)?
    char[]与TCHAR[]互相转换引发的一个问题!
    关于 AfxSocketInit()
    href="#"与href="javascript:void(0)"的区别
    Camera帧率和AE的关系(转)
    详细的摄像头模组工作原理!!!(转)
    高清摄像头MIPI接口与ARM处理器的连接(转)
  • 原文地址:https://www.cnblogs.com/taobataoma/p/1045916.html
Copyright © 2011-2022 走看看