D
Dom
In my application, the user can bring up a dialog box that contains a
listbox. The listbox has about 6000 items, obtained by reading a
table in a Database. The dialog box is brought up every minute or so,
and I do not want the user to wait for that dialog box to rebuild the
listbox each time.
I see this done often enough. For example, in the CSharp studio
itself, the intellisense window pops up regularly, without a moment's
pause, and it contains much more than 6000 items. I assume the box is
being built just once, and then the popping on and off is just a
matter of making it visible and invisible.
How do I do this? Right now, the dialog box is never disposed in the
calling procedure. I just have a static variable that holds it, and
then I call frmWindow.ShowDialog (this), when I need it. And when the
user gives an answer, I call this.Close() to end it.
But still there is a pause, and using the debugger, I can see that the
dialog box is calling each items ToString() method, so I assume this
is being done just to repaint the listbox. Is there a better way?
listbox. The listbox has about 6000 items, obtained by reading a
table in a Database. The dialog box is brought up every minute or so,
and I do not want the user to wait for that dialog box to rebuild the
listbox each time.
I see this done often enough. For example, in the CSharp studio
itself, the intellisense window pops up regularly, without a moment's
pause, and it contains much more than 6000 items. I assume the box is
being built just once, and then the popping on and off is just a
matter of making it visible and invisible.
How do I do this? Right now, the dialog box is never disposed in the
calling procedure. I just have a static variable that holds it, and
then I call frmWindow.ShowDialog (this), when I need it. And when the
user gives an answer, I call this.Close() to end it.
But still there is a pause, and using the debugger, I can see that the
dialog box is calling each items ToString() method, so I assume this
is being done just to repaint the listbox. Is there a better way?