Mario De Ghetto

Microsoft MVP – Visual Basic (VB.NET: Programmare che passione!)

Archivio per 9 Aprile 2008

#29: Svuotare tutte le TextBox di un form

Pubblicato da Mario De Ghetto su 9 Aprile 2008

Per svuotare tutte le TextBox di un form, è possibile utilizzare questo codice:

Dim ctrl As New Form.ControlCollection(Me)

ctrl = System.Windows.Forms.Form.ActiveForm.Controls

For Each c As Control In ctrl

   If TypeOf (c) Is System.Windows.Forms.TextBox Then

      c.Text = ""

   End If

Next

Pubblicato su Tips | 5 Commenti »