This is a migrated thread and some comments may be shown as answers.

How to remove space taken by an invisible PictureBox

3 Answers 304 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Matthew Hile
Top achievements
Rank 1
Matthew Hile asked on 25 Feb 2011, 09:49 PM
I have a stack of picture boxes which grab a static image based on the value of the field. If the value of a field is < a certain value I set Visible = False. However, there is an empty space where the (now) invisible picture box would have been placed. I suspect this is because the Location for the next box is hard coded.

Is there a way to eliminate that blank space?

Thanks,

Matthew

3 Answers, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 02 Mar 2011, 04:15 PM
Hi Matthew Hile,

When an item is hidden, the default behavior is to move all of the items below to an upper position. However if you hide an item that is on the same Y axis as the hidden one, the items below will move to that item and will not be able to move on upper position. Check out the referenced forum thread that includes a sample report to demonstrate the described behavior: Toggle.Visibility does not collapse the white space

Best wishes,
Peter
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
0
Matthew Hile
Top achievements
Rank 1
answered on 02 Mar 2011, 07:24 PM
Thanks, I finally got the space to disappear when I placed the PictureBox within a panel. (Making the picture box invisible did not work.) I do not think I had a Y axis placement issue because the panel takes the same position as the PictureBox.

So is the trick placing them in a Panel?
0
Steve
Telerik team
answered on 07 Mar 2011, 06:41 PM
Hello Matthew,

The Panel is a container item that can grow to accommodate its children whenever necessary and it also separates the location dependency of items. So this is a possible and valid solution.

Kind regards,
Steve
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
Tags
General Discussions
Asked by
Matthew Hile
Top achievements
Rank 1
Answers by
Peter
Telerik team
Matthew Hile
Top achievements
Rank 1
Steve
Telerik team
Share this question
or