CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Threaded View

  1. #1
    Join Date
    Mar 2009

    [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 02:49 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Windows Mobile Development Center

Click Here to Expand Forum to Full Width

On-Demand Webinars (sponsored)

We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.