I have the following codes:
In my form, there is three user control, it able to remove the first and the third one, but it's not able to remove the second one. I believe it's caused by the for each statement where it will directly go to the third user control and skip the second after remove the first one.Code:For Each ctrl As Control In Me.SplitContainer1.Panel1.Controls If ctrl.GetType.ToString = "Adjustment.UI.ucSubApproval" Then Me.SplitContainer1.Panel1.Controls.Remove(ctrl) End If Next




Reply With Quote