Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6935321
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T12:05:13+00:00 2026-05-27T12:05:13+00:00

I have a problem with the width of a label and its container. I

  • 0

I have a problem with the width of a label and its container.
I have 1 panel to the right that will take as much space as it’s possible, on the left one VGroup, width 1 panel on top that will take the needed width for children and 1 panel on bottom that will have the same width as the left top panel.

On the top left panel there is a button that will change its width.
On the down left panel there is a label that will adjust its width to its container panel, that way, the label will make breakpoints to fit properly on its container.

It works correctly at start and resizes correctly when button’s width grow bigger. But when the button changes to a smaller width, the left panels and groups remain at the same size as before, so the left part only grow bigger when needed and never decrease its width.

<fx:Script>
    <![CDATA[
        protected function buttonClick(event:MouseEvent):void{
            button.width= 70+Math.random()*200;
        }
        protected function vgroupResize():void{}
    ]]>
</fx:Script>

<s:HGroup width="500" height="500">
    <s:VGroup id="vGroup" height="100%" resize="vgroupResize()">
        <s:Panel id="leftUp" title="left up" width="100%" height="100%" minWidth="1">
            <s:Button id="button" label="button" click="buttonClick(event)"/>
        </s:Panel>

        <s:Panel id="leftDown" title="left down" width="{leftUp.width}">
            <s:Label width="100%" text="nyan n y a n nyan n y a n nyan n y a n nyan n y a n nyan n y a n nyan n y a n nyan"/>
        </s:Panel>
    </s:VGroup>

    <s:Panel title="right" width="100%" height="100%"/>
</s:HGroup>

I’ve found 2 ugly solutions that always work, but I want the proper way or a less horrible way to do that.

One solution is setting leftDown.width= 1 the moment the button changes its width:

        protected function buttonClick(event:MouseEvent):void
        {
            button.width= 70+Math.random()*200;
            leftDown.width= 1;
        }

Other solution is removing the left bottom panel the moment the button changes its width and re-adding when VGroup is resized:

        protected function buttonClick(event:MouseEvent):void
        {
            button.width= 70+Math.random()*200;

            if(leftDown.parent!=null) vGroup.removeElement(leftDown);
        }

        protected function vgroupResize():void
        {
            if(leftDown.parent==null) vGroup.addElement(leftDown);
        }

I hope someone knows the proper way to do that.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T12:05:14+00:00Added an answer on May 27, 2026 at 12:05 pm

    my opinion is to make the vpanel width as bindable to button width like this

    <s:HGroup width="500" height="500">
            <s:VGroup id="vGroup" width="{button.width + 2}" height="100%" resize="vgroupResize()">
                <s:Panel id="leftUp" title="left up" width="100%" height="100%" minWidth="1">
                    <s:Button id="button" label="button" click="buttonClick(event)"/>
                </s:Panel>
    
                <s:Panel id="leftDown" title="left down" width="{leftUp.width}">
                    <s:Label width="100%" text="nyan n y a n nyan n y a n nyan n y a n nyan n y a n nyan n y a n nyan n y a n nyan"/>
                </s:Panel>
            </s:VGroup>
    
            <s:Panel title="right" width="100%" height="100%"/>
        </s:HGroup>
    

    This is quite simple than other.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have problem with fancybox. I want to write a function that will run
I have the following <label for=Forename>Forename</label> <%= Html.TextBoxFor(m => m.Customer.Name.Forename) %> the problem with
I have some interesting problem for an hour.. In my flex project, all width
I have a problem with a master page containing a asp:textbox that I'm trying
I have a panel sitting in a div, and I want to use that
I have Tab Container, and i have a GridView inside that. I need to
I have written a program that uses widgets as container (for other widgets). Because
I have problem with return statment >.< I want to store all magazine names
I have problem with starting processes in impersonated context in ASP.NET 2.0. I am
I have problem with ActionLink. I'd like to pass to my ActionLink parameter for

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.