Clear all text boxes on form excluding one text box

DustyCarpet

Member
Joined
Sep 4, 2013
Messages
8
Programming Experience
1-3
Hi I'm using the following code to clear all the text boxes from a form but I want to retain the value of one ID text box only. How do I exclude one textbox from being cleared by the code

Thanks


VB.NET:
  For Each ctrl As Control In root.Controls
           ClearTextBox(ctrl)
           If TypeOf ctrl Is TextBox Then
               CType(ctrl, TextBox).Text = String.Empty
           End If
        Next ctrl
 
Back
Top