3 Replies Latest reply on Dec 10, 2009 7:24 AM by martin.berg

    Styling LinkButton

    martin.berg

      Hi,

       

      I am trying to style a linkbutton but it does not work

       


          
              button = new LinkButton();
              button.label = labelProp.getValue(node);
              button.styleName = "treeMapLinkButton";
              button.setStyle("fontFamily", "Supertext 01");
              button.setStyle("fontSize", "10");
              button.setStyle("verticalAlign", "middle");
              button.setStyle("paddingTop", "0");
              button.setStyle("paddingBottom", "0");
              button.setStyle("paddingLeft", "0");
              button.setStyle("paddingRight", "0");

       

      I set a custom font and also do it in the external css style nothng works ???

        • 1. Re: Styling LinkButton
          Gregory Lafrance Level 6

          What happens when you try to set the font in MXML:

           

           

          <?xml version="1.0" encoding="utf-8"?>
          <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
            <mx:LinkButton label="ChikaraDev" fontFamily="Arial" fontSize="20" 
              click="navigateToURL(new URLRequest('http://www.ChikaraDev.com'), '_blank')"/>
          </mx:Application>

           

          What happens when you try to set the font to some other non-custom font?

           

          If this post answers your question or helps, please mark it as such.


          Greg Lafrance
          www.ChikaraDev.com

          Flex Development and Support Services

          • 2. Re: Styling LinkButton
            martin.berg Level 1

            Well i got it working with

             

            LinkButton {
                    cornerRadius: 0;
                    rollOverColor: #ffffff;
                    selectionColor: #ffffff;
                    color: #000000;
                    textRollOverColor: #000000;
                    textSelectedColor: #000000;
                    fontFamily: "Supertext 01";
                    fontSize: 10;
                }

             

            Except it does not use my custom font which is the most important part

             

            I know the font works it does in other componets

            • 3. Re: Styling LinkButton
              martin.berg Level 1

              The solution is to set the font weight to normal