简体   繁体   English

Vb.net中的AutoSize DataGridView

[英]AutoSize DataGridView in Vb.net

How can the table be auto fitted in the DataGridView using VB.NET ? 如何使用VB.NET将表自动装入DataGridView中? The operations like AutoSizeColumn and AutoSizeRows are only for the data inside the table. 诸如AutoSizeColumn和AutoSizeRows之类的操作仅适用于表中的数据。 I want to fit the table inside the Viewbox in such a manner that no extra space will left. 我想以这样的方式将表格放入Viewbox内,即不会留下多余的空间。

You'll have to calculate and set the row heights/column widths yourself, based on the height/width of the DataGridView . 您必须根据DataGridView的高度/宽度自己计算和设置行高/列宽。

This is most often (and most effectively) done in the Resize event handler. 这通常在Resize事件处理程序中(最有效)完成。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM