Font and Color Dialogs intermittently take an exceptionally long time to display on certain user machines.  Any idea why?  I cannot reproduce locally.

Posted on 2004-08-31
Last Modified: 2013-12-03
I have a charting application that has many users.  Why viewing a chart, they can right-click and choose the preferences option to launch another form that is shown modally to modify the parameters of the chart.  On this new form there are many buttons for modifying the colors and fonts of the chart.  When they click on one of these buttons, I simply show a Color(or Font) Dialog with simple code:

ColorDialog dlg  = new ColorDialog();
dlg.Color = (Some Default Color);
Color result = dlg.Color;

A user called this morning and said it was taking between 6-10 minutes for the dialogs to reveal themselves.  The moment he clicked the button to launch the above code he was no longer able to touch any of the charts, receiving a beep in complaint, as though the Color dialog was visible (shown modally).  He simply had to wait it out and respond to the dialog.  He also said he received similar delays with the Font dialog.  Again, it is only 'some' users and only 'some' times.  This user does not always experience this issue.

Any ideas would be helpful, I dont see anything I can change.


The same user has informed me that even MessageBox dialogs are taking extended amounts of time to display.

Question by:ericdotnet
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2

Accepted Solution

petoskey-001 earned 500 total points
ID: 11983373
It sounds like the disk is thrashing.  On computers with not enough ram, windows will swap out the currently running memory to the hard drive and then bring it back from the hard drive to real memory.  It does this transparently so programs don't notice, but users sure do.  I would suggest your client buy more ram.

As far as your code, it's late so I can't think right now what you would check.  

Expert Comment

ID: 11983374
oh Yeah, is it limited to just your program?  My guess is it happens to most programs of similar size, or when running several applications on his computer.

Author Comment

ID: 11984444
It is just my program, but the program _does_ take huge amounts of ram - half a gig or so (it pulls market data from many financial exchanges).  I'll have him upgrade his ram and see if that resolves it.

Author Comment

ID: 12146448
petoskey-001, you had it right.  It turns out that GDI+ objects are not truly managed objects and they need to be explicitely disposed of.  I was not doing this and they were eating up all of the systems ram and filling up the page files, hence the slow dialogs.  Thanks for helping me find the bug! :)

Expert Comment

ID: 12147002
Ah, The wonders of C#.  It's a nice language, but to do anything low level or you end up falling back on your C skills.  Glad to hear you found the problem.  

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
Ever visit a website where you spotted a really cool looking Font, yet couldn't figure out which font family it belonged to, or how to get a copy of it for your own use? This article explains the process of doing exactly that, as well as showing how…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

691 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