Visual Studio 2008 WPF Editor Tips - Part 1

October 4th, 2007

I was sent by Lab 49 to the Microsoft Platform Adoption Center in Redmond, WA to help Microsoft test Windows Presentation Foundation (WPF) version 3.5 and Visual Studio 2008.   I was able to try out many of Lab 49’s applications using the latest builds while having access to many members of the WPF development team.   I picked up many tips and tricks for Visual Studio 2008 and WPF that I’ll be passing along in a series of blog posts.

The first tip is for editing Grid layouts in Visual Studio 2008’s WPF designer that I got from the programmer responsible for this feature, Mark Wilson-Thomas .  What many people don’t realize is there are two distinct modes for resizing grid cells in the WPF designer.  

Grid Edit 2008

The green arrow above points to a small triangle that resizes the grid but leaves any content the same size.   The blue arrow points to a grid line you can move to resize the grid cell and resize the contents as well.  An example will make this more clear.

After moving the triangle to the left, the grid looks like this:

image

Notice that the button did not resize with the cell.   This mode is handy for when you need to change the spacing in a grid, but not the size of the grid contents.

If you drag the grid line to the left instead of using the triangle, then the grid looks like this:

image

The button is now smaller instead of staying the same size like it did before.

This feature is difficult to discover and confusing.  In post-Beta 2 bits, the mouse icon changes slightly to give a hint about what mode the resize is using.

I’ll blog more about the grid editor in my next post.

Comments are closed.