6 Replies Latest reply on Nov 26, 2009 5:41 AM by Matt Le Fevre

    adjacent checkboxes

    dentalplus

      Anybody know how I can get checkboxes to appear in a row without any label or gaps between them.

      I can remove the label text, but I always have a gap between. I just want a group of three in a grid.

       

      TIA

        • 1. Re: adjacent checkboxes
          Matt Le Fevre Level 4

          quickest way would be to give them specific coordinates eg:

           

          <?xml version="1.0" encoding="utf-8"?>
          <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
               <mx:CheckBox x="326"  y="128"/>
               <mx:CheckBox x="340" y="128"/>
               <mx:CheckBox  x="354" y="128"/>
          </mx:Application>
          
          

           

          but thats far from ideal.

           

          I'm guessing you're using them in an hbox, which has default padding. Another guess would be to create a custom hbox component that didn't have the padding between components

          • 2. Re: adjacent checkboxes
            dentalplus Level 1

            Thanks for the quick response,

             

            I'm using them straight in a griditem...

             

            <mx:GridItem width="100%" height="100%">
                 <mx:CheckBox/><mx:CheckBox/><mx:CheckBox/>
            </mx:GridItem>
            

            • 3. Re: adjacent checkboxes
              dentalplus Level 1

              Ah, just tried your suggestion and added a canvas to the griditem and it'll work for now.

               

              Thanks

               

              <mx:GridItem width="100%" height="100%">
                   <mx:Canvas width="42" height="100%">
                   <mx:CheckBox x="0" y="0"/>
                   <mx:CheckBox x="14" y="0"/>
                   <mx:CheckBox x="28" y="0"/>
                   </mx:Canvas>
              </mx:GridItem>
              

              • 4. Re: adjacent checkboxes
                Subeesh Arakkan Level 4

                Hi,

                 

                You can also use an HBox and set the horizontalGap to 0. So you dont have to specify the x, y values

                <mx:HBox width="100%" height="100%" horizontalGap="0">
                     <mx:CheckBox/><mx:CheckBox/><mx:CheckBox/>
                </mx:HBox>
                
                • 5. Re: adjacent checkboxes
                  Matt Le Fevre Level 4

                  Subeesh Arakkan wrote:

                   

                  Hi,

                   

                  You can also use an HBox and set the horizontalGap to 0. So you dont have to specify the x, y values

                  <mx:HBox width="100%" height="100%" horizontalGap="0">
                       <mx:CheckBox/><mx:CheckBox/><mx:CheckBox/>
                  </mx:HBox>
                  

                   

                  there we go, i was sure it was going to be something insanely simple

                   

                  Keep forgetting how much work Flex does for you.

                  • 6. Re: adjacent checkboxes
                    dentalplus Level 1

                    Grizzzzzzzzzz wrote:

                     

                    Subeesh Arakkan wrote:

                     

                    Hi,

                     

                    You can also use an HBox and set the horizontalGap to 0. So you dont have to specify the x, y values

                    <mx:HBox width="100%" height="100%" horizontalGap="0">
                         <mx:CheckBox/><mx:CheckBox/><mx:CheckBox/>
                    </mx:HBox>
                    

                     

                    there we go, i was sure it was going to be something insanely simple

                     

                    Keep forgetting how much work Flex does for you.

                    I wasn't thinking simply enough either!