Dim sp1() As Integer = {1,10,13} Dim sp2() As Integer = {7,8} For Each i As Integer In sp1 Dim sp As WinForm.SplitContainer = e.Form.Controls("SplitContainer" & i) sp.Panel1.Collapsed = True Next For Each i As Integer In sp2 Dim sp As WinForm.SplitContainer = e.Form.Controls("SplitContainer" & i) sp.Panel2.Collapsed = True Next