Wednesday, November 28, 2007

How to center a control or object within a grid within the page

I have a grid with a control in it. I want the control ( or object ) to be centered in the grid when the window is expanded. This is how I did it:

The grid

Width is set to : Auto

Height to: 705.5 (yours will be different, it is whatever you want/need)

Row 1
Row Span 1
Column 0
ColumnSpan 2

Horizontal Alignment Center
Vertical Alignment Center


My control :

Width 533
Height 600
Row 0
Row Span 1
Column 0
Column Span 1
Horizontal Alignment Stretch
Vertical Alignment Stretch