Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何以编程方式将 WPF 的 Data Gide 控件的高度和宽度设置为 Auto。
要Auto在后面的代码中设置元素的宽度/高度,您只需将值设置为double.NaN
Auto
double.NaN
myControl.Width= double.NaN; myControl.Height = double.NaN;