|
-
Mar 26th, 2000, 03:15 AM
#1
Thread Starter
Dazed Member
Does any body know how i can clear out all of the contents of my text boxes in my application?
If text1.text = visible then
clear text1.text '???????????????
I really have no idea how to accomplish this task
Thanks =C)
-
Mar 26th, 2000, 03:26 AM
#2
Fanatic Member
When I need to do this I make sure all my text boxes have the same tag. eg 'TextBox'
Then you could do something like :
dim ctl as control
for each ctl in me
if ctl.tag = "TextBox" then ctl.Text = ""
next ctl
You have to trap the error which occurs when a control without a tag property is checked. Sorry can't remember it off hand, as all my VB stuff is at work.
Hope this helps.
-
Mar 26th, 2000, 04:17 AM
#3
Thread Starter
Dazed Member
Thanks Steve,
I see what you mean by setting all of the tags to something to like textbox. This way i guess you can use
a For Each - Next loop to to repeat a group of statements for each element in a collection of objects. Did i say that Right??? {{{laughing}}} but i still have to figure out the group part in the , For Each (element) In Group. Group would be the????????
Thanks again.
-
Mar 26th, 2000, 04:23 AM
#4
Thread Starter
Dazed Member
Thanks Steve,
I see what you mean by setting all of the tags to something to like textbox. This way i guess you can use
a For Each - Next loop to to repeat a group of statements for each element in a collection of objects. Did i say that Right??? {{{laughing}}} but i still have to figure out the group part in the , For Each (element) In Group. Group would be the????????
Thanks again.
-
Mar 26th, 2000, 05:39 AM
#5
Lively Member
Try This
Hello,
Here you go a little piece of code which should help you,
Code:
Dim obj As Object
For Each obj In Me.Controls
If TypeOf obj Is TextBox Then
obj.Text = ""
End If
Next
Hope it helps,
Desire.
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
|