VB 的datagrid自定义列如何添加?

来源:百度知道 编辑:UC知道 时间:2024/05/26 03:16:58
软件只带了2个列 我想自己添加 第三个 ~

界面里点击datagrid控件,
法一:如果已经连接数据源、表、有查询语句,单击右键,选择“字段刷新”(retrieve fields),确定。
法二:单击右键,选择“编辑”(edit)编辑该控件,通过编辑控件(此时再次单击右键,插入行或列)完成

Dim c As Column
Set c = DataGrid1.Columns.Add(DataGrid1.Columns.Count)

With c
.Visible = True
.width = 2500
.Caption = "you need"End With