English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

without clearing every radio button check box or text box individually?

2006-12-14 08:07:34 · 3 answers · asked by ohhhgoodness 3 in Computers & Internet Programming & Design

3 answers

You will want to iterate the controls collection like so :

Private Sub cmdClear_Click()
...ClearTextBoxes Me
End Sub

Public Function ClearTextBoxes(ByRef frmTarget As Form)
...Dim ctl As Control

...'Clear all the TextBoxes
...For Each ctl In frmTarget.Controls
......Debug.Print ctl.Name
......'It would probably be best to turn the statement below
......'into a case statement. Then this could be a multi-purpose
......'clearer, but I did not want to have all the fun!
......If TypeOf ctl Is TextBox Then ctl.Text = ""
...Next ctl
End Sub


This is the easiest route I can think of. Hope that helps!

2006-12-14 08:16:22 · answer #1 · answered by Special Ed 5 · 1 0

I don't think you can, you have to tell each one to clear individually. If you have an array like "button(1)" and "button(2)" then you can use a for...next loop:

for x = 1 to 10
button(x).clear
next x

2006-12-14 08:10:59 · answer #2 · answered by Yoi_55 7 · 0 0

nicely you are able to double click on the button, and have it make a number of here instructions: in the adventure that your style call is form1 then: form1.seen = fake; And create a 2d style, and set the residences of it to be seen>fake (there must be a drop down field on the main suitable fringe of the field whilst the style is chosen. If this way is form2, then in the subsequent line after making style a million invisible, you are able to say form2.seen = actual. THat way you are able to change between the two with out having to do any no longer ordinary programming to sparkling strings out of particular fields and such making use of in simple terms one style.

2016-10-14 23:03:49 · answer #3 · answered by dusik 4 · 0 0

fedest.com, questions and answers