For i=0 to intRow
strRow = SwfWindow("XXX").SwfTable("XXX").GetCellData(i,1)
If strRow="test123" Then
intRowNum = i
Exit for
End If
Next作者: 450683057 时间: 2012-7-11 16:47
1.根据字段值,选中所在行,函数如下!
' 根据字段值选择所在的行
Function SelectRowByField(w_DataGridView , Field , FieldText)
' Reporter.Filter = rfDisableAll
For I = 0 to w_DataGridView.RowCount - 1
If w_DataGridView.GetCellProperty(I,Field,"Value") = FieldText Then
w_DataGridView.SelectRow I
SelectRowByField = True
Exit Function
End If
Next
' Reporter.Filter = rfEnableAll
SelectRowByField = False
End Function
RegisterUserFunc "SwfTable","SelectRowByField","SelectRowByField"
2.通过 h=obj.GetROProperty("CurrentRow.Index") '获取当前行号。作者: 450683057 时间: 2012-7-11 16:49
我也刚学QTP互相交流
MSN:hongxu.jiang12@hotmail.com(上班用)
qq:450683057