I have an interesting solution when all the list boxes are visible and i want to make only one of them visible :
Private Function SetVisible(ctl As Control)
' eg.g. SetVisible Me.ListBox1
Dim ctl2 As Control
ctl.Visible = True
ctl.SetFocus
For Each ctl2 In Me.Controls
If ctl2.ControlType = acListBox Then
If Not ctl2 Is ctl Then
ctl2.Visible = False
End If
End If
Next ctl2
End Function
Now i have another button with which i must set all the list boxes invisible, even the list box that is visible at the moment.How could i do that ?
Private Function SetVisible(ctl As Control)
' eg.g. SetVisible Me.ListBox1
Dim ctl2 As Control
ctl.Visible = True
ctl.SetFocus
For Each ctl2 In Me.Controls
If ctl2.ControlType = acListBox Then
If Not ctl2 Is ctl Then
ctl2.Visible = False
End If
End If
Next ctl2
End Function
Now i have another button with which i must set all the list boxes invisible, even the list box that is visible at the moment.How could i do that ?