Page view counter
Resize canvas children in design-time. (Expression Blend 2) Subscribe to this thread
Last post 01-12-2009 9:21 AM by AdmiralGanja. 4 replies.
Sort Posts:
01-05-2009 3:16 AM
Resize canvas children in design-time. (Expression Blend 2)

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...

 

AdmiralGanja

Loading...
Joined on 07-06-2007
Posts 29
01-05-2009 10:12 AM
Marked as Answer
Re: Resize canvas children in design-time. (Expression Blend 2)

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.

Thanks,
Beer John
myOSity Project Website, Blog

prujohn

Loading...
Joined on 04-06-2007
Texas
Posts 489
01-07-2009 3:42 AM
Re: Re: Resize canvas children in design-time. (Expression Blend 2)

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

AdmiralGanja

Loading...
Joined on 07-06-2007
Posts 29
01-09-2009 4:01 AM
Marked as Answer
Re: Resize canvas children in design-time. (Expression Blend 2)

 Hi,

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.

 

Amanda Wang
Microsoft Online Community Support

Please remember to mark the replies as answers if they help and unmark them if they provide no help.

Amanda Wang - MSFT

Loading...
Joined on 04-30-2007
Posts 1,015
01-12-2009 9:21 AM
Re: Re: Resize canvas children in design-time. (Expression Blend 2)

That worked out very nice... I don't know how I could miss that the previous post contained the answer :) Thanks!!!

/Jesper

AdmiralGanja

Loading...
Joined on 07-06-2007
Posts 29
Microsoft Communities