Windows Vista Forums
Vista Forums Home Join Vista Forums Donate Vista Tutorials Tags

Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
Register at Vista forums...the world biggest Windows Vista resource Join Vista Forums Now

Go Back   Vista Forums > Microsoft Technical Newsgroups > Avalon

Using StackPanel and User Controls

Update your Vista Drivers Update Your Drivers Now!!
Closed Thread
 
Thread Tools Display Modes
Old 02-25-2007   #1 (permalink)
Jay
Guest


 

Using StackPanel and User Controls

Hello,

I have a Window, which contains a stackpanel. I've added two WPF
UserControls, each of which contains a Canvas and some elements within the
canvases.

The problem I have the two User Controls stacked, however, it appears the
second Canvas's elements are drawing from the top of the Window, not the
second canvas. I can place a TextBlock in the Canvas and set Canvas.Top="1",
however, the "1" is set from the Window, not the Canvas in which it is
contained. Maybe it's taking a cue from the first Canvas.

Anyone know how to address this issue? Or what I'm doing wrong? I'd rather
not compensate for this in the User Control, as I want them to be separate,
and not know what the other is doing.



My System SpecsSystem Spec
Old 03-23-2007   #2 (permalink)
WPCoder
Guest


 

Re: Using StackPanel and User Controls

Are you explicitly setting the height of the UserControls you're adding (and
the contained Cavnas?). I'd think you'd want to use a container class that
sizes to fit rather than using a Cavnas. There's no containment on the
canvas, although I wouldn't expect it to do what you're describing exactly.

--Aaron

http://www.wiredprairie.us


"Jay" <jipock@acm.org> wrote in message
news:e6GOaYUWHHA.5060@TK2MSFTNGP06.phx.gbl...
> Hello,
>
> I have a Window, which contains a stackpanel. I've added two WPF
> UserControls, each of which contains a Canvas and some elements within the
> canvases.
>
> The problem I have the two User Controls stacked, however, it appears the
> second Canvas's elements are drawing from the top of the Window, not the
> second canvas. I can place a TextBlock in the Canvas and set
> Canvas.Top="1", however, the "1" is set from the Window, not the Canvas in
> which it is contained. Maybe it's taking a cue from the first Canvas.
>
> Anyone know how to address this issue? Or what I'm doing wrong? I'd rather
> not compensate for this in the User Control, as I want them to be
> separate, and not know what the other is doing.
>


My System SpecsSystem Spec
Closed Thread

Thread Tools
Display Modes



Similar Threads
Thread Thread Starter Forum Replies Last Post
WPF user controls interacting with each other Eps Avalon 3 12-29-2007 08:28 PM
User account controls Larry S. Vista security 1 11-13-2007 08:40 AM
User Account Controls Larry S. Vista security 9 10-25-2007 01:03 AM
WPF user controls without XAML Cairn Avalon 2 04-12-2007 01:36 PM
User controls in a ControlTemplate Griff Avalon 1 05-26-2006 04:28 AM


Vistax64.com is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media 2005-2008

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51