VB中怎么对DataGrid1的宽度设置

2025-03-06 22:45:11
推荐回答(2个)
回答1:

Vb中对DataGrid1的宽度设置的代码如下:
DataGrid1.Columns(1).Width = 2000'将DataGrid1中的第一列宽度设置为2000

关于DateGrid控件:

该数据识别的DataGrid控件看起来与Grid控件类似。但是,可以设置DataGrid控件的DataSource属性为一个Data控件,以自动填充该控件并且从Data控件的Recordset对象自动设置其列标头。这个DataGrid控件实际上是一个固定的列集合,每一列的行数都是不确定的。

回答2:

调整DataGrid1的宽度须在DataGrid1附值以后调整