• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 631
  • Last Modified:

How do I resize a panel object when removing some of it's children?

I have a very simple panel in a flex app.  This panel has several buttons.

I can remove these buttons at will, via the panel.removeChild(buttonName) call.  That works fine.

Is there a way for me to then resize the panel once this child display object is removed?  I want the panel to grow in size dynamically, based on the content within.  There is no option for not including the child in the layout before or after it is removed, or if there is, I cannot find it.
0
csciguy81
Asked:
csciguy81
  • 2
  • 2
1 Solution
 
lexxwernCommented:
Have you specified a width and height for the Panel? By default it should fit its children's size (hence resize automatically on Add/Remove of children) if the width & height are not defined.
0
 
zzynxSoftware engineerCommented:
Did you already try

panel.invalidateProperties();
or
panel.invalidateDisplayList();
or
panel.invalidateSize();
or a combination

after removing of the button?
0
 
csciguy81Author Commented:
The width/height of the panel is not defined.  It takes on the size of the child components width/height.

I will give any of those a try and report back.  
0
 
csciguy81Author Commented:
The app has taken a bit of a different direction so to speak.  Is there a way to resize the panel, but to always have it fit into the width or height of the resolution that the screen/browser is set to?

Basically if I make an app at 1024x768, and someone views it at 800x600, then the 800x600 person has to scroll around.  Is there a way to automagically make my app scale or shrink down to fit their screen?
0
 
zzynxSoftware engineerCommented:
>> Is there a way to resize the panel, but to always have it fit into the width or height of the resolution that the screen/browser is set to?
That's maximizing the panel.
This will probably be useful for you: http://flexscript.wordpress.com/2008/08/28/flex-minimize-maximize-panel-component/
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now