Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27201

[RESOLVED] Problem Loading ComboBoxes in VB 2010 Express

$
0
0
I have a Windows Form with 30 ComboBoxes.

I want the List Items to be: D, W, M and O for the first 20 comboboxes.

I want the List Items to be Y and N for the last 10 comboboxes.
The field Name of first of the last 10 comboboxes is "FirstCustEmail".

The code below will of course work on all 30 comboboxes.

How can I modify the code below to accomplish the above?


Problem Code:
  1. Private Sub LoadComboBoxes()      
  2.         For Each ctrl In Controls
  3.             If TypeOf (ctrl) Is ComboBox Then
  4.                 ctrl.items.add("D")
  5.                 ctrl.items.add("W")
  6.                 ctrl.items.add("M")
  7.                 ctrl.items.add("O")
  8.             End If
  9.         Next
  10.  End Sub

Viewing all articles
Browse latest Browse all 27201

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>