By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,827 Members | 2,195 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,827 IT Pros & Developers. It's quick & easy.

Wierd issue with listbox and Begin...Endupdate

P: n/a
OK, here's a wierd one... I have a listbox, which I fill with strings (in my
case, file names). I normally load this via a loop, adding each item to the
list box in the loop. I put lb.BeginUpdate before the start of the loop, and
lb.EndUpdate at the conclusion of the loop.

Here's the wierd part: If there is only ONE line loaded into the list box,
the list box SHOWS UP AS BLANK! It says there is 1 item in the box, but it
never shows up on the screen, nor can it be clicked. However, if TWO or more
items are loaded into the list box, they all show up fine!

I've traced this to the Begin and End Update statements. If I remove these,
then everything works fine - including only loading one item into the
listbox. The second that I put the Begin..EndUpdate lines back in, the
previous behavior occurs.

Any ideas as to why? Is this a list box bug? I would like to use the
Begin...EndUpdate as I could end up loading a large amount of data into the
listbox. But for the time being, I will have to remove the lines.

BTW, using VB.NET 2003 with Framework 1.1

Nov 20 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.