cplusplus

DataGrid控件

上一篇 / 下一篇  2011-07-05 00:03:05 / 个人分类:VB

Private Sub Command1_Click()
    'Label1.Caption = DataGrid1.Columns(1).CellValue(DataGrid1.Bookmark)
    Label1.Caption = DataGrid1.Columns(1).Text
End Sub

Private Sub Command2_Click()
    DataGrid1.Row = 2   '设置当前行,从0开始
End Sub

Private Sub Command3_Click()
'下面两行代码修改特定单元格内容
    DataGrid1.Row = 3'设置当前行为3
    DataGrid1.Columns(1).Text = "4"'修改当前行第二列的内容
    'DataGrid1.Text = "4"   '修改活动单元格
End Sub

Private Sub Form_Load()
Adodc1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\english.mdb;Persist Security Info=False"
'Adodc1.Recordset
End Sub

'VbWindow("Form1").ActiveX("DataGrid").Object.Row = 2   'QTP中

'MsgBox VbWindow("Form1").ActiveX("DataGrid").Object.Columns(1).Text'获取内容


TAG: DataGrid控件

 

评分:0

我来说两句

Open Toolbar