Trouble viewing the items in the listbox in Windows form application

Posted on 2004-11-16
Last Modified: 2010-04-15
I am having trouble with displaying items in a listbox. I am using the following code in Visual Studio.Net 2003 for a windows form application

  private void button1_Click(object sender, System.EventArgs e)

When I keep on pressing the button the text gets added to the list box ( as it is know by the movement of the scroll bar in the list box) but the items in list box are not visible. I have made sure that property visible of listbox is set to true. Still, i am unsuccessful

Can anyone please reply to my question

Question by:partulu
    LVL 8

    Expert Comment

    This should work.  Set a breakpoint on the line and check the value of textBox1.Text in debug mode by hovering over it with the mouse or looking in the watch window.  Make sure textBox1.Text != "".

    Hope this helps.  Cheers -Aaron
    LVL 11

    Accepted Solution

    This link might be of a help to u


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Article by: Ivo
    C# And Nullable Types Since 2.0 C# has Nullable(T) Generic Structure. The idea behind is to allow value type objects to have null values just like reference types have. This concerns scenarios where not all data sources have values (like a databa…
    In order to hide the "ugly" records selectors (triangles) in the rowheaders, here are some suggestions. Microsoft doesn't have a direct method/property to do it. You can only hide the rowheader column. First solution, the easy way The first sol…
    This video discusses moving either the default database or any database to a new volume.
    Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

    760 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    8 Experts available now in Live!

    Get 1:1 Help Now