0

I have 10 combo boxes in a tab control on a form. I want to select all on form load event as follows-

var comboBoxes = this.Controls.OfType<ComboBox>().ToList();

But it selects only one. Any help?

s.k.paul
  • 7,099
  • 28
  • 93
  • 168
  • 1
    Are they nested in sub-containers? [Get all controls of a specific type](https://stackoverflow.com/q/4630391/669576) – 001 Oct 17 '17 at 17:00
  • Yes, those are in a tab control on two different tab pages. – s.k.paul Oct 17 '17 at 17:02
  • You will need a recursive solution, which is basically answered [here](https://stackoverflow.com/a/4630450/1789202) – CSharpie Oct 17 '17 at 17:08

0 Answers0