Private Sub DataGrid1_ButtonClick(ByVal ColIndex As Integer) Select Case ColIndex Case 2 'You can do other Column as this With List1 'Show a List Box in DataGrid If .Visible Then .Visible = False: Exit Sub .Top = DataGrid1.Top + DataGrid1.Columns(ColIndex).Top + (DataGrid1.RowHeight + 15) * (DataGrid1.Row + 1) .Left = DataGrid1.Left + DataGrid1.Columns(ColIndex).Left .Width = DataGrid1.Columns(ColIndex).Width .Visible = True .SetFocus End With End Select
Case 2 'You can do other Column as this
With List1 'Show a List Box in DataGrid
If .Visible Then .Visible = False: Exit Sub
.Top = DataGrid1.Top + DataGrid1.Columns(ColIndex).Top + (DataGrid1.RowHeight + 15) * (DataGrid1.Row + 1)
.Left = DataGrid1.Left + DataGrid1.Columns(ColIndex).Left
.Width = DataGrid1.Columns(ColIndex).Width
.Visible = True
.SetFocus
End With
End Select
End Sub