sgfriske
asked on
I can't seem to get text to display in a list box or combo box when I run the Form_Load procedure
Good morning all
I can't seem to get text to display in a list box or combo box when I run the Form_Load procedure, I am working off of an old version of VB studio.net and I am wondering if the tag has changed and that is why you can't see them when I run the application??
Code I have is this, which is correct for the 2003 version? Why not for the 2002 version?
ListBox1.Items.Add("U.S. Dollar")
ComboBox1.Items.Add("U.S. Dollar")
Thanks
I can't seem to get text to display in a list box or combo box when I run the Form_Load procedure, I am working off of an old version of VB studio.net and I am wondering if the tag has changed and that is why you can't see them when I run the application??
Code I have is this, which is correct for the 2003 version? Why not for the 2002 version?
ListBox1.Items.Add("U.S. Dollar")
ComboBox1.Items.Add("U.S. Dollar")
Thanks
ASKER
Here is my code I do have the handles mybase.load in it
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'These program statements run when the form loads
PictureBox1.Image = System.Drawing.Image.FromF ile _
("c:\vbnet03sbs\chap03\inp ut controls\pcomputr.bmp")
'Add items to a list box like this:
ListBox1.Items.Add("Extra hard disk")
ListBox1.Items.Add("Printe r")
ListBox1.Items.Add("Satell ite dish")
'Combo boxes are also filled with the Add method:
ComboBox1.Items.Add("U.S. Dollars")
ComboBox1.Items.Add("Check ")
ComboBox1.Items.Add("Engli sh Pounds")
End Sub
it works fine I can't get the List box and combo box items to display for the users
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'These program statements run when the form loads
PictureBox1.Image = System.Drawing.Image.FromF
("c:\vbnet03sbs\chap03\inp
'Add items to a list box like this:
ListBox1.Items.Add("Extra hard disk")
ListBox1.Items.Add("Printe
ListBox1.Items.Add("Satell
'Combo boxes are also filled with the Add method:
ComboBox1.Items.Add("U.S. Dollars")
ComboBox1.Items.Add("Check
ComboBox1.Items.Add("Engli
End Sub
it works fine I can't get the List box and combo box items to display for the users
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
I copied your code into a project and it works fine. What happens if you single step thru the procedure?
ASKER
OK I will give that a shot, they have not changed the syntak since the 2002 version of VB studio.net?
Make sure that the Form_Load procedure is actually being called. Check the handler "Handles Mybase.Load" at the end.