2 Replies Latest reply on Feb 19, 2010 4:38 AM by JockMahon

    Close button in panel

    JockMahon Level 1

      How do i put

      components in the header of a panel so like a minamise button for example

       

      thanks

        • 1. Re: Close button in panel
          David_F57 Level 5

          Hi,

           

          there are several ways you can do this, my personal favorite is through the skin so that way if I already have several panels I want to apply the effect to I just set the skin.

           

          I have attached a very simple project that opens and closes a panel with a button,

           

          All I did was reduce the minheight of the component to 30 created a button on the title bar , added a variable to hold the original height and a click event for the button

           

          protected function expandBtn_clickHandler(event:MouseEvent):void

          {

          if (hostComponent.height == fullHeight) hostComponent.height = 32 else hostComponent.height=fullHeight; 

          }

          Its a simple example you would probably put more into a 'nice' toggle button caption etc but it gives you a little insight into one persons ideas
          David

          • 2. Re: Close button in panel
            JockMahon Level 1

            That's great. Thank you for your time!