Grid表格里面有RowDefinitions行和ColumnDefinitions列,因为是行和列所以就要在里面添加宽度和高度,高度和宽度后面都是有单位的。
计算机的图形设计的标准单位是像素(Pixel),所以Grid的宽度和高度单位就是像素了。除此之外Grid的宽度和高度还接受英寸(Inch)简写in、厘米(Centimeter)简写cm和点(Point)简写pt。
下面是添加单位的代码:
<Window x:Class="WpfApplication1.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d=