haroldjclements Posted June 13, 2004 Posted June 13, 2004 I have a problem with converting my VB.NET code to J#.NET 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! for (int x=1; x<32; x++) { this.cbxDays.??????????(x); } Any help will be appreciated. Thanks, Harold Clements Quote
*Experts* mutant Posted June 13, 2004 *Experts* Posted June 13, 2004 cbxDays.get_Items().Add("Hello"); :) Quote
haroldjclements Posted June 13, 2004 Author Posted June 13, 2004 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. Quote
*Experts* mutant Posted June 13, 2004 *Experts* Posted June 13, 2004 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. cbxDays.get_Items[b]()[/b].Add("something") All function calls need parenthesis. Quote
haroldjclements Posted June 13, 2004 Author Posted June 13, 2004 Yep, your right ..... sorry! Cheers mate :D Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.