|
-
Mar 26th, 2000, 03:22 AM
#1
Thread Starter
Dazed Member
Does any one know how i could erase all of the contents of my text boxes in my application?
If text1.text = visible then
erase text1.text '?????????????????
I have no idea how to accomplish this task.
Thanxxxxxx =C)
-
Mar 26th, 2000, 03:40 AM
#2
Hyperactive Member
Here try this
If text1.text = visible Then
text1.text = ""
End if
Matt 
-
Mar 26th, 2000, 03:13 PM
#3
Frenzied Member
To clear ALL the textboxes on your form...
Declare a variable as a Control, and loop through all the controls on your form. If the type of control is a textbox, set it's caption to an empty string.
Here's an example:
Put a command button named Command1 on your form, and as many textboxes as you want. Then paste the following code into your form's code window.
When you run the project, type text into all the textboxes. Then click the command button to clear them all.
Code:
Option Explicit
Private Sub Command1_Click()
Dim Ctrl As Control
For Each Ctrl In Me.Controls
If TypeOf Ctrl Is TextBox Then
Ctrl.Text = ""
End If
Next Ctrl
End Sub
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|