Skip to main content
Home Forums Silverlight Programming Silverlight Controls and Silverlight Toolkit Resize canvas children in design-time. (Expression Blend 2)
4 replies. Latest Post by AdmiralGanja on January 12, 2009.
(0)
AdmiralG...
Member
11 points
29 Posts
01-05-2009 3:16 AM |
Hi,
I'm designing a toolbar with buttons. On the toolbar I have a container user control that holds a group of buttons, similar to office 2007 menues. This user control concists of a "canvas" containing a "border" control for layout and a "stackpanel" control for tiling up buttons horisontally.
When I resize this container user control in design time to get room for more buttons, the children of the canvas doesnt get resized. I have tryed setting canvas and/or root element of the control to the scale transformation. Maybe I do it wrong... Even when I'm in design view of the user control itself, it doesnt rescale the canvas children together with the canvas itself...
Please let me know how to do this.. There has got to be a simple way for something so basic right?Thanks in advance...
prujohn
Contributor
3429 points
688 Posts
01-05-2009 10:12 AM |
Try changing your root Canvas control to a Grid control instead. Remove any explicit sizing from your border (no width/height properties set), and it should stretch along as you resize your UserControl.
01-07-2009 3:42 AM |
I made a grid and dragged it out on my page just to try this. I dragged a border inside this control and removed all sizing tags (width, heigth, margins = 0.). But it still doesn't get resized or anything when resizing grid in design time... Hmm.... Any hints?
/Jesper
Amanda W...
All-Star
17234 points
1,466 Posts
01-09-2009 4:01 AM |
AdmiralGanja: This user control concists of a "canvas" containing a "border" control for layout and a "stackpanel" control for tiling up buttons horisontally.
Based on your description, you have a "stackpanel" control for tiling up buttons horisontally, when you resize the stackpanel/border, the child controls only resize vertically.
You can try to use Grid control instead of the StackPanel control , the child controls can resize both vertically and horisontally when you resize their parent contron.
01-12-2009 9:21 AM |
That worked out very nice... I don't know how I could miss that the previous post contained the answer :) Thanks!!!