Discussion Locked

How to clear all text boxes

0 helpful
3 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

Can someone help me out here?
Want I want to do is clear all my text and combo boxes without having to do each one individually.
I've done it before but I can't remember how.

3 replies

by andrew

It helps if you let us know what platform/language you're using, but here's a way for a Win32 app in VB:

Dim oControl as Control
For Each oControl In Form1
Select Case TypeName(oControl)
Case "TextBox"
oControl.Text = ""
Case "ComboBox"
oControl.Clear
End Select
Next

by craig shepherd

Sorry about that. It would have been a great idea.
I'm using VB6, so that code is exactly what I was looking for.
Thanks for your help.

This discussion is closed to new replies.