473,378 Members | 1,360 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Rapid Open/Close of a Windows Form

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!
Nov 19 '05 #1
3 1618
Not really. ListBox is based on the old ListView control and has
limitations.

--
Bob Powell [MVP]
Visual C#, System.Drawing

Ramuseco Limited .NET consulting
http://www.ramuseco.com

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.

"Bill Kinnersley" <bi***@eecs.ku.edu> wrote in message
news:11*************@corp.supernews.com...
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!

Nov 20 '05 #2
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?

"Bob Powell [MVP]" <bob@_spamkiller_bobpowell.net> wrote in message
news:Oo**************@TK2MSFTNGP12.phx.gbl...
Not really. ListBox is based on the old ListView control and has
limitations.
--
Bob Powell [MVP]
Visual C#, System.Drawing

"Bill Kinnersley" <bi***@eecs.ku.edu> wrote in message
news:11*************@corp.supernews.com...
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!

Nov 20 '05 #3
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.

"Bill Kinnersley" <bi***@eecs.ku.edu> wrote in message
news:11*************@corp.supernews.com...
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?

"Bob Powell [MVP]" <bob@_spamkiller_bobpowell.net> wrote in message
news:Oo**************@TK2MSFTNGP12.phx.gbl...
Not really. ListBox is based on the old ListView control and has
limitations.
--
Bob Powell [MVP]
Visual C#, System.Drawing

"Bill Kinnersley" <bi***@eecs.ku.edu> wrote in message
news:11*************@corp.supernews.com...
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!


Nov 24 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: carloschoenberg | last post by:
I am looking for the easiest web interface to a database. By easiest, I mean most rapid development. Because the requirements are so simple and standard, I'm hoping that something can take care of...
18
by: Roger Withnell | last post by:
I open a new window from the current window to display maps. Several maps of different sizes can be displayed. The function is given the size of the map and adjusts the window size accordingly....
3
by: stumorgan | last post by:
There is probably an extremely simple answer to this question and I'm just being foolish. I have a main form (let's say FormMain) which opens other forms (let's say Form1, Form2). How do I keep...
3
by: Karan | last post by:
I am calling finalize when form2 loads and deactivates form1 which closes form1. However, same thing is not happening in form2 because finalize is already called. Does anybody has solution to it....
5
by: Sudha Pune | last post by:
Hi all Just i want to close the form1 when i click the button1 on form1 and the same time i want to load the form2 on the same event. And i dont want to hide the form1 instead of close....
3
by: Ronald S. Cook | last post by:
I know how to close and open a form... Well.. but can you tell me how can I do this..... Example... There are 2 forms...named formA and formB and each of them have their own button named...
13
by: Academic | last post by:
I have a MDI form, sometimes child forms and sometimes forms that are neither If I close the app the child forms closing and closed event happens followed by the Mdi form receiving the...
13
by: robert.waters | last post by:
Do you have your users rely on the windows taskbar to manage/navigate between the forms they have open, or do you provide another (more robust) method? Does anyone use a custom navigation system...
24
by: dancer | last post by:
Using ASP.net 1.1 and Microsoft Access. I received the following error message. Why? I have closed the Access file. I have another very small access file that opens with no trouble with the...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.