by merror (3 Submissions)
Category: Miscellaneous
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Mon 3rd January 2000
Date Added: Mon 8th February 2021
Rating: (1 Votes)
Clear all textboxes, comboboxes, listviews,...... from a form. General, works with all forms and all controls (I haven't yet tested all but it
API Declarations
Dim MyControl As Control
'you may expand this function with as many typeofs as u like :)
'contact: [email protected]
For Each MyControl In frmName.Controls
If TypeOf MyControl Is TextBox Then MyControl.Text = ""
If TypeOf MyControl Is CheckBox Then MyControl.Value = vbUnchecked
If TypeOf MyControl Is ComboBox Then MyControl.Clear
If TypeOf MyControl Is ListView Then MyControl.ListItems.Clear
If TypeOf MyControl Is RichTextBox Then MyControl.Text = ""
Next
End Sub
No comments have been posted about Clear all textboxes, comboboxes, listviews,...... from a form. General, works with all forms and al. Why not be the first to post a comment about Clear all textboxes, comboboxes, listviews,...... from a form. General, works with all forms and al.