Controls

Shirim9

New member
Joined
Sep 14, 2008
Messages
1
Programming Experience
Beginner
Hi All,

Wondering how to achieve doing this in VB.net. The codes below are from VB6
In vb.net, the codes i have used are exactly the same until the part that is highlighted in RED which i could not find the corresponding way to do so.

VB.NET:
Expand Collapse Copy
For each vcontrol in Form1.controls
   if typeof vcontrol is combobox then
      [COLOR="Red"]vcontrol.additem[/COLOR] ("Test1")
   end if
Next
 
VB.NET:
Expand Collapse Copy
For Each v As Control In Me.Controls
  If TypeOf v Is ComboBox Then
    Ctype(v, ComboBox).Items.Add("Text1")
  End If
Next
 
Back
Top