Sorry, this is in VB code and I don't know the for each equivalent off the
top of my head.
For Each ctl In Form.Controls
If TypeOf ctl Is ComboBox Then
ct1.Text = ""
ct1.SelectedText = ""
End If
Next
"Keith Smith" <(E-Mail Removed)> wrote in message
news:eyrOd.22893$uc.16994@trnddc09...
> Is there an easier way to clear all of the comboBoxes on my form? I am
> currently using this code...
>
> autoCompleteComboBox1.Text="";
> autoCompleteComboBox1.SelectedText="";
>
> autoCompleteComboBox2.Text="";
> autoCompleteComboBox2.SelectedText="";
>
> autoCompleteComboBox3.Text="";
> autoCompleteComboBox3.SelectedText="";
>
> autoCompleteComboBox4.Text="";
> autoCompleteComboBox4.SelectedText="";
>
> autoCompleteComboBox5.Text="";
> autoCompleteComboBox5.SelectedText="";
>
> autoCompleteComboBox6.Text="";
> autoCompleteComboBox6.SelectedText="";
>
>
> ....But it would be nice if I could do something like this:
>
> AllControls.Clear;
>
|