VB中的mshflexgrid的双击任一行数据,将不同列数据添加到不同文本框中,求代码? 100
Private Sub DataGrid1_RowColChange(LastRow As Variant, ByVal LastCol As Integer) '当选中控件中的数据时,将选中的数据在右边的Text中显示每个字段
If m = True Then
Text1.Text = Trim(DataGrid1.Columns("学生学号").CellText(DataGrid1.Bookmark))
Text2.Text = Trim(DataGrid1.Columns("学生姓名").CellText(DataGrid1.Bookmark))
Combo1.Text = Trim(DataGrid1.Columns("学生性别").CellText(DataGrid1.Bookmark))
DTPicker1.Value = Trim(DataGrid1.Columns("出生日期").CellText(DataGrid1.Bookmark))
Text3.Text = Trim(DataGrid1.Columns("联系电话").CellText(DataGrid1.Bookmark))
Text4.Text = Trim(DataGrid1.Columns("籍贯").CellText(DataGrid1.Bookmark))
Text5.Text = Trim(DataGrid1.Columns("院系").CellText(DataGrid1.Bookmark))
Text6.Text = Trim(DataGrid1.Columns("专业").CellText(DataGrid1.Bookmark))
Combo2.Text = Trim(DataGrid1.Columns("宿舍编号").CellText(DataGrid1.Bookmark))
End If
End Sub