> Private Sub LoopTextBoxes() > > ' Variables > Dim nCnt% > Dim oType As System.Type > Dim frmTrgt As System.Web.UI.HtmlControls.HtmlForm > Dim txtObj As System.Web.UI.WebControls.TextBox > > ' Loop Controls - Get Form > For nCnt = 0 To Controls.Count - 1 > > ' Assign Type > oType = Controls(nCnt).GetType > > ' Determine Match > If InStr(UCase(oType.FullName), "HTMLFORM", CompareMethod.Text) Then > > ' Assign Value > frmTrgt = Controls(nCnt) > > ' Bail > Exit For > > End If > > ' Free Memory > oType = Nothing > > Next > > ' Loop Controls - Get Form > For nCnt = 0 To frmTrgt.Controls.Count - 1 > > ' Assign Type > oType = frmTrgt.Controls(nCnt).GetType > > ' Determine Match > If InStr(UCase(oType.FullName), "TEXT", CompareMethod.Text) Then > > ' Assign Control > txtObj = frmTrgt.Controls(nCnt) > > ' Assign Value > txtObj.Text = "Got It" > > ' Free Mem > txtObj = Nothing > > End If > > ' Free Memory > oType = Nothing > > Next > > End Sub >>
"If ye love wealth better than liberty, the tranquility of servitude better than the animated contest of freedom, go home from us in peace. We ask not your counsel or arms. Crouch down and lick the hands which feed you. May your chains set lightly upon you, and may posterity forget that ye were our countrymen."
~Samuel Adams