Combo Boxes!

haroldjclements

Well-known member
Joined
Jun 13, 2004
Messages
46
I have a problem with converting my VB.NET code to J#.NET

Code:
Dim x
For x = 1 To 31
   Me.cbxDays.Item.Add(x)
Next

I know the loop in J#, just not the code for adding the item to the combo box!

Code:
for (int x=1; x<32; x++)
{
    this.cbxDays.??????????(x);
}
Any help will be appreciated.

Thanks,
Harold Clements
 
I have tried that and I get the error:

"Cannot find field get_Items in class System.Windows.Forms.ComboBox

I have "import System.Windows.Forms.*;" in my code.
 
It works. If you remove the parenthesis from after get_Items that error will be thrown. Make sure to use excatly what I showed you.
Code:
   cbxDays.get_Items[b]()[/b].Add("something")
All function calls need parenthesis.
 
Back
Top