For Each cb As ComboBox In Me.Controls.OfType(Of ComboBox)()
...
Next
Не знал про такую фишку как OfType.Nord777 писал(а):
- Код: Выделить всё
For Each cb As ComboBox In Me.Controls.OfType(Of ComboBox)()
...
Next
Nord777 писал(а):
- Код: Выделить всё
For Each cb As ComboBox In Me.Controls.OfType(Of ComboBox)()
...
Next
>%SystemRoot%\Microsoft.NET\Framework\v3.5\vbc ComboBoxSample.vb
Microsoft (R) Visual Basic Compiler version 9.0.30729.1
Copyright (c) Microsoft Corporation. All rights reserved.
>ComboBoxSample.exe
>%SystemRoot%\Microsoft.NET\Framework\v2.0.50727\vbc ComboBoxSample.vb
Microsoft (R) Visual Basic Compiler version 8.0.50727.3053
for Microsoft (R) .NET Framework version 2.0.50727.3053
Copyright (c) Microsoft Corporation. All rights reserved.
\ComboBoxSample.vb(11) : error BC30456: 'OfType' is not a member
of 'System.Windows.Forms.Control.ControlCollection'.
For Each cb As ComboBox In Me.Controls.OfType(Of ComboBox)()
~~~~~~~~~~~~~~~~~~
Сейчас этот форум просматривают: нет зарегистрированных пользователей и гости: 19