i have few text boxes on my form.
but they are inside one or more group boxes.
means they are directly not placed on the form.
and there are more than one group box on the form
i want to clear all the text boxes.
how do i do that
Printable View
i have few text boxes on my form.
but they are inside one or more group boxes.
means they are directly not placed on the form.
and there are more than one group box on the form
i want to clear all the text boxes.
how do i do that
you can loop thru the group boxes and set each textbox to an empty string.
try this
VB Code:
Dim c As Control For Each c In Me.Controls If TypeOf ctrl Is TextBox Then c.Text = "" Next END if
lol pirate that wont work for what he asked for, he says that the txtboxes are in group boxes then that code simple wont work...what he'll have to do is like the other guy said make a loop thru the form looking for txtboxes and groupboxes..and when he finds groupboxes he will have to make another loop thru all it's controls looking for txtboxes
Sorry, I should read the post carefully next time :rolleyes:
i will forgive u this time, next time i wont be so soft :D
lol . :pQuote:
Originally posted by PT Exorcist
i will forgive u this time, next time i wont be so soft :D
What about making the different sets of TextBoxes into collections (arrays of just TextBoxes)? Wouldn't that work as well?