Rapid Open/Close of a Windows Form

  • Thread starter Thread starter Bill Kinnersley
  • Start date Start date
B

Bill Kinnersley

I have a Windows Form with a very large ListView, about 10,000 items. There
is a very significant delay each time the form is opened (ShowDialog) or
closed (Hide). The ListView has not been modified in between, but for some
reason the graphics associated with it must be getting destroyed at each
Hide and re-created at each Show. Is there any way to avoid this, and hence
avoid the lengthy pause?

Thanks!
 
All I want to do is trick Windows into not disposing the control's graphics
between Shows. Something like double buffering? I wouldn't think that a
way to do this would depend on the particular control involved, but maybe
it does. Is there another grid control that would make it possible?
 
Well, I have a workaround. Noting that Hide produces a long delay,
but changing Visible does not, we do the following -- Form A ShowDialogs a
teeny little Form B, which makes Form C (containing the big ListView)
visible. When done, we make C not visible, then Hide B, passing the results
back along the way to A. This is quite a kludge, and I find it hard to
believe there is not a better way.

Thanks,
Bill K.
 
Back
Top