![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
|
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.
br> br> |
| |||||||
![]() |
| | Thread Tools | Display Modes |
| | #1 (permalink) |
| 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 Specs![]() |
| | #2 (permalink) |
| 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 Specs![]() |
![]() |
| 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 |