' Assuming Option Strict On > > ' System.Web.UI.WebControls. appears to be optional. > > Dim oControl As Control > Dim oTextBox As New System.Web.UI.WebControls.TextBox() > Dim oDropDown As New DropDownList() > Dim oCheckBox As New CheckBox() > Dim oListBox As New ListBox() > Dim oRadioButton As New RadioButton() > Dim oButton As New Button() > > ' Note that on my web form the controls I am looking for are in Item(1).Controls > > For Each oControl In Me.Controls.Item(1).Controls > > Select Case oControl.GetType.ToString > > Case oTextBox.GetType.ToString > oTextBox = CType(oControl, TextBox) > oTextBox.Enabled = False > > Case oDropDown.GetType.ToString > oDropDown = CType(oControl, DropDownList) > oDropDown.Enabled = False > > Case oCheckBox.GetType.ToString > oCheckBox = CType(oControl, CheckBox) > oCheckBox.Enabled = False > > Case oListBox.GetType.ToString > oListBox = CType(oControl, ListBox) > oListBox.Enabled = False > > Case oRadioButton.GetType.ToString > oRadioButton = CType(oControl, RadioButton) > oRadioButton.Enabled = False > > Case oButton.GetType.ToString > oButton = CType(oControl, Button) > 'oButton.Enabled = False > > End Select > > Next oControl