Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

16. WPF Controls > The GridSplitter 1-2-3

The GridSplitter 1-2-3

Spreadsheets like Microsoft Excel are obviously grids, but even things like Windows Explorer have identifiable grid components. Most of those windows allow you to change the relative size of the panes by clicking and dragging. The tool for adding that functionality in WPF is the GridSplitter. Most discussions of the GridSplitter, including those on MSDN, make it sound a lot more difficult to use than it actually is, because they set a bunch of properties that are largely irrelevant for the most usual case. So, here’s my three-step process for making a row or column of a grid resizeable using the GridSplitter control:

1 CREATE A ROW OR COLUMN DEFINITION TO CONTAIN THE GRIDSPLITTER

Set the Width property of the row or column to the width of the splitter. You can make it anything you want, but “5” is usually a good place to start. You can put the control in a row or column with other elements, but making sure the


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free 10-Day Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint