March 18th, 2009, 03:18 PM
[RESOLVED] Change which item resizes in DockPanel
I have a DockPanel with two items in it, one docked to the left, and one docked to the right. By default, when the DockPanel is resized, the item on the right resizes to fill the space, whereas the left item stays the same. How do I get it so that the left item resizes and the right item stays the same.
<Button Name="button1" >ButtonA</Button>
<Button Name="button2" DockPanel.Dock="Right">ButtonB</Button>
I want button1 to resize when the DockPanel resizes instead of button2.
Edit: I forgot to mention that the reason I'm using a DockPanel in the first place (as opposed to a Grid or some other panel) is that I want the ability to set the visibility of button2 to "collapsed" and then have button1 fill to take up the whole area. In my actual implementation, what I'm actually trying to do is have a panel that takes up the whole window. When a button is clicked (a "more options" type of thing), a second panel appears, and the two panels share the area in the window. I'd be open to any method of getting this done; I just thought a DockPanel made the most sense.
Last edited by Eric H; March 18th, 2009 at 03:49 PM.
Click Here to Expand Forum to Full Width
This is a CodeGuru survey question.