2011-03-03 62 views
0

当我读取GridColumn的宽度值时,我得到在xaml(640像素)中设置的默认值。但是该列比运行时更宽,因为它根据浏览器的宽度延伸。在运行时,我想缩放一些控件来匹配,但是当我读取列的值时,它仍然给我默认值640.直到我用gridsplitter实际调整列的大小,正确的值才能通过。任何人都知道如何在运行时获得列的实际宽度,而不必先调整它的大小?在运行时读取宽度值

Double a = this.Column1.Width.Value; // Gives me the default value of 640 while the column is much wider than that. 

回答

0

尝试

Double a = this.Column1.ActualWidth.Value; 
+0

它完美。非常感谢你 :) – 2011-03-03 11:23:21

相关问题