The Grid Panel

The Grid is one of the easiest panels to understand in WPF. It basically allows creating tables, with rows and columns. In this way you can define cells and each cell can contain a control or another panel storing nested controls. The Grid is versatile in that you can just divide it into rows or into columns or both. The following code defines a Grid that is divided into two rows and two columns:

image

RowDefinitions is basically a collection of RowDefinition objects, and the same is for ColumnDefinitions and ColumnDefinition. Each item respectively represents a row or a column within the Grid. You can also specify a Width or a Height ...

Get Visual Basic® 2010 Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.