zoukankan      html  css  js  c++  java
  • Styling the Alert control’s nested buttons

    The following example shows how you can customize the appearance of the buttons in an Alert control in Flex by setting the buttonStyleName style
    <?xml version="1.0" encoding="utf-8"?>
    <!-- http://blog.flexexamples.com/2008/01/03/styling-the-alert-controls-nested-buttons/ -->
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
            layout
    ="vertical"
            verticalAlign
    ="middle"
            backgroundColor
    ="white"
            creationComplete
    ="init();">

        
    <mx:Style>
            @font-face {
                src: local("Comic Sans MS");
                fontFamily: myComicSansMS;
                fontWeight: normal;
            }

            Alert {
                buttonStyleName: myCustomButtonStyleName;
            }

            .myCustomButtonStyleName {
                color: red;
                cornerRadius: 12;
                fontFamily: myComicSansMS;
                fontSize: 10;
                fontWeight: normal;
                textDecoration: underline;
                themeColor: red;
            }
        
    </mx:Style>

        
    <mx:Script>
            
    <![CDATA[
                import mx.controls.Alert;

                private var alert:Alert;

                private function init():void {
                    var myMessage:String = "Lorem ipsum dolor sit amet, consectetuer adipiscing elit.\nDonec tincidunt sollicitudin sem.";
                    var myTitle:String = "The quick brown fox jumped over the lazy dog";
                    alert = Alert.show(myMessage, myTitle);
                }
            
    ]]>
        
    </mx:Script>

        
    <mx:ApplicationControlBar dock="true">
            
    <mx:Button label="Launch alert" click="init();" />
        
    </mx:ApplicationControlBar>

    </mx:Application>

  • 相关阅读:
    winform学习(4)控件的添加、显示和隐藏
    winform学习(3)窗体事件
    《深入理解XGBoost》
    《一篇文章搞定GBDT、Xgboost和LightGBM的面试》
    >>深入理解AutoML和AutoDL:构建自动化机器学习平台
    《浏览器工作原理与实践》 7
    《Effective Java 第三版》——《骨架实现类》
    《深入理解JVM & G1 GC》【5】
    《深入理解JVM & G1 GC》【4】
    《深入理解JVM & G1 GC》【3】
  • 原文地址:https://www.cnblogs.com/taobataoma/p/1034727.html
Copyright © 2011-2022 走看看