Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > MarkupLabel Control
  New Posts New Posts RSS Feed - Elastic Objects in WrapPanel
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Elastic Objects in WrapPanel

 Post Reply Post Reply
Author
Message
jpbro View Drop Down
Senior Member
Senior Member
Avatar

Joined: 12 January 2007
Status: Offline
Points: 1354
Post Options Post Options   Thanks (0) Thanks(0)   Quote jpbro Quote  Post ReplyReply Direct Link To This Post Topic: Elastic Objects in WrapPanel
    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

Back to Top
jpbro View Drop Down
Senior Member
Senior Member
Avatar

Joined: 12 January 2007
Status: Offline
Points: 1354
Post Options Post Options   Thanks (0) Thanks(0)   Quote jpbro Quote  Post ReplyReply Direct Link To This Post 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

Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.125 seconds.