Question Listbox is not working

andrews

Well-known member
Joined
Nov 22, 2011
Messages
149
Programming Experience
5-10
When I write the coding text , Form1.ListBox1.Items.Add("nu wel") every where , I don't see anything in my listbox1 in the debugging mode.
And in the properties I see nothing what can be the reason.
Mystery?
 
Please provide a FULL and CLEAR explanation of the problem. If you see nothing in your ListBox at run time then it's because you haven't added anything to it. We don't know what your code actually looks so we can't tell you what's wrong with it. For all we know, that line you mention isn't even being executed.

Firstly, you need to debug your code properly. That would probably involve putting a breakpoint on the line(s) that you expect to add the item(s) and then run the project to see whether that line is actually hit. If it isn't then we can't help if that's the only line we know about. If it is hit and an item is not added then we still need to see the context in which that execution occurs. To that end, you should be providing us with a code sample that demonstrates the issue and, preferably, contains nothing that is not relevant to the problem. If you have to create a new test project with minimal code to do that, that's what you do. That's what you should often be doing anyway, as part of your own testing. Testing specific problem code without any additional noise is often the best way to isolate a specific issue.
 
Back
Top