在datagrid显示的数据中,我想双击任一行,即取得该行的值,放入文本框text1,text2中,有何好办法实现?datagrid表: id name
12 gg
13 bb
15 jj
12 gg
13 bb
15 jj
解决方案 »
- VB6加水晶报表9,不知怎样传入参数
- List1.List(List1.ListIndex)和list1的区别?
- VB调用数据库,由于数据量太大,有什么好的方法处理用户界面呢,不至于界面死在那里
- 一个我觉得好难实现的问题!!!
- 一个数组QQ(1 to 100) as int,怎样统计其重复数据分布情况,或像SQL那样分组统计,有结果马上揭帖!
- 大家发一些ADO的使用方法吧!
- 获取当前输标所在位置句柄的API是什么呀?
- 怎么用ReleaseDC?
- 如何获得PROGRAM FILES和common的路径
- 使用Crystal Repot,可以预览,打印不正常,是怎么回事?
- 请问vb2005中有网格的控件吗?
- 向组合框里添加为什么保存不住呀??
Dim RowValue, ColValue
RowValue = DataGrid1.RowContaining(Y)
ColValue = DataGrid1.ColContaining(x)
If RowValue >= 0 And RowValue <= DataGrid1.VisibleRows And _
ColValue >= 0 And ColValue <= DataGrid1.VisibleCols Then
DataGrid1.Row = RowValue
End If
Dim i As Long
For i = 0 To DataGrid1.Columns.Count - 1
If DataGrid1.Columns(i).Caption = "id" Then
Text1.Text = DataGrid1.Columns(i).Value
Exit For
End If
Next
For i = 0 To DataGrid1.Columns.Count - 1
If DataGrid1.Columns(i).Caption = "name" Then
Text2.Text = DataGrid1.Columns(i).Value
Exit For
End If
Next
End Sub
text2.text=rs.field("name")