Skip to content

How to code Listbox - beginner's help

shahab mushtaq

Asked Jun 14, 2006, 6:12 AM EDT2 answers
Share
LinkedInX
Hi,
I just started taking a VB.Net class and need some help with my first assignment.  I can't figure out the syntax code for how to add text to a Listbox.   My assignment is to add a Listbox to a form and then add specific text to the Listbox.  I need to show my code. 
I tried ListBox1.Item = "text" but this isn't working.  Any help would be much appreciated.

Shahab

1 Answer

Know the answer? Post it. Somebody with the same question will find it here.

  • 0


    Try this:

    LIstBox1.Items.Add("text")

    or to add items from a textbox:

    LIstBox1.Items.Add(Textbox1.Text)

    0
  • 1 short reply
    • 0
      thanks that did it.
      0