[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now


A listbox control is drawing itself before it's been populated?

Posted on 2004-11-30
Medium Priority
Last Modified: 2010-04-15
This list belongs to a group which is too high in the tab order, I think.  It's trying to draw itself when it hasn't yet been filled.

Any ideas about how to delay the drawing of the listbox or how to change the order of the group so this doesn't happen?

Question by:ba272

Expert Comment

ID: 12712730
Whenever it adds an item to the listbox, it will get drawn. Can you post the code?
LVL 20

Accepted Solution

TheAvenger earned 2000 total points
ID: 12714984
The methods you need are BeginUpdate() and EndUpdate(). You should call BeginUpdate before you start adding elements to the list box and call EndUpdate after you are finished. Here is what MSDN says about BeginUpdate:

Maintains performance while items are added to the ListBox one at a time by preventing the control from drawing until the EndUpdate method is called.

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
Loops Section Overview

872 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