Link to home
Start Free TrialLog in
Avatar of sgfriske
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
Avatar of Erick37
Erick37
Flag of United States of America image

Private Sub Form_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

Make sure that the Form_Load procedure is actually being called.  Check the handler "Handles Mybase.Load" at the end.
Avatar of sgfriske
sgfriske

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.FromFile _
          ("c:\vbnet03sbs\chap03\input controls\pcomputr.bmp")
        'Add items to a list box like this:
        ListBox1.Items.Add("Extra hard disk")
        ListBox1.Items.Add("Printer")
        ListBox1.Items.Add("Satellite dish")
        'Combo boxes are also filled with the Add method:
        ComboBox1.Items.Add("U.S. Dollars")
        ComboBox1.Items.Add("Check")
        ComboBox1.Items.Add("English Pounds")
    End Sub

it works fine I can't get the List box and combo box items to display for the users
ASKER CERTIFIED SOLUTION
Avatar of Howard Cantrell
Howard Cantrell
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I copied your code into a project and it works fine.  What happens if you single step thru the procedure?
OK I will give that a shot, they have not changed the syntak since the 2002 version of VB studio.net?