tags:

views:

329

answers:

2

I have a problem in flex scroll bars. I have a mxml component based on canvas. Inside that I have used a VBox for my form. Above that Vbox I have another canvas just for title.

My form gets longer than normal screen size when the grid inside that is filled with more data. In that case I want a vertical scroll bar just for Vbox in which my form is located. But the whole canvas is getting scrollbar including title canvas. how to solve this problem.

I set vertical scrollbar policy of main canvas to off and inside Vbox's VerticalScrollbarPolicy to on. but that's not working. It is not overriding the property of parent container.

Thanks.

+1  A: 

Keep your Form inside a Canvas inside the parent canvas instead of VBox. VBox and HBox are set to grow automatically in the parent container, so if your form grows, your corresponding VBox will grow as well.

Akash Kava
Thank you. It works.
Please rate the answer if it did help you.
Akash Kava
A: 

You want to overload the "updateDisplayList" function for your parent canvas, and force the height of your form Vbox to be canvasHeight-titleHeight (including padding, space, etc...) so that the VBox never grows larger than the screen. This will solve your problem. Just make sure you check for the existence of the VBox as sometimes the updateDisplayList will be called before it has been instantiated.

Glenn