Print Page | Close Window

Elastic Objects in WrapPanel

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: MarkupLabel Control
Forum Description: Topics Related to Codejock MarkupLabel Control
URL: http://forum.codejock.com/forum_posts.asp?TID=17599
Printed Date: 27 April 2024 at 1:34am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Elastic Objects in WrapPanel
Posted By: jpbro
Subject: Elastic Objects in WrapPanel
Date Posted: 24 November 2010 at 4:52pm
I want to put a few charts on a markup page. Some could be wide, some could be square. If I put these in a WrapPanel object, then as many that will fit in a row as possible will, and the rest will automatically move to the next row.

This is nice, and working as expected.

However, what would be nicer:

Is there was a way to stretch a child object of the WrapPanel to the full width of the panel if it is the only object on the row (the next object wrapped to the next line because it wouldn't fit), but squish it down to >=MinimumWidth if the next object will fit.

So instead of ending up with this:



We get this:



Thanks in advance for any tips.


-------------
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3

Language: Visual Basic 6.0 SP6




Replies:
Posted By: jpbro
Date Posted: 24 November 2010 at 6:16pm
A more basic version of what I am looking for:

Here's what I get right now when I put objects in a WrapPanel:



Since the MinWidth attribute of the red box is 150, the blue and green boxes get wrapped to the next line. But because I haven't defined a Width for the red box, I would like it to actually fill the remaining space in the panel, so this:



Is there any way to accomplish this?

Thanks again.


Here's the XAML in case you want to try to get it to work with similar code:


<Page HorizontalAlignment='Left' Margin='10' Width='204'>
<Border Height='204' BorderThickness='2' BorderBrush='Black'>
<WrapPanel>
<Border MinWidth='150' HorizontalAlignment='Stretch' Height='100' Background='Red'/>
<Border Width='100' Height='100' Background='Blue'/>
<Border Width='100' Height='100' Background='Green'/>
</WrapPanel>
</Border>
</Page>



-------------
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3

Language: Visual Basic 6.0 SP6




Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net