4

I have a ListView, set up in what I believe is a completely standard way in a C# .Net 3.5 project, running on a laptop using XP, which pretty much stays on the whole time (although I reboot it about once a month or if I install any new software).

On coming in in the morning, I sometimes notice this greeting me when I unlock my machine:

Scrollbars showing background through http://www.premierekitchens.co.uk/storage/DodgyScrollbars.png

As you can see, the scrollbars are showing my background through them. They have turned transparent. They still "work", in that the mouse can interact with them, but they do not update at all.

And strangest of all, any child windows (which get created and destroyed in the usual c# way) also have this problem. And not just on ListViews. Standard text boxes also have this issue.

I've searched, but I cannot find anything about this anywhere.

Does anyone have any ideas on a) what's causing it? and b) how I can fix it?

Jonathan
  • 25,873
  • 13
  • 66
  • 85
  • Is this also happening with other .NET applications? – Bobby Mar 17 '11 at 08:29
  • Also, are you manipulating the scrollbars in any way? – Bobby Mar 17 '11 at 08:33
  • @BoltClock: It's a form created in windows on a one-click application which is running locally. – Jonathan Mar 17 '11 at 13:25
  • @Bobby: No other applications seem to be affected, and I am not manipulating the scrollbars in any way. – Jonathan Mar 17 '11 at 13:26
  • Do you just need to restart the application or the whole system to get it normal again? – Bobby Mar 17 '11 at 13:30
  • Yes. A restart of the application itself is enough to solve the problem. – Jonathan Mar 23 '11 at 08:02
  • What about minimizing/maximizing, does that cause them to repaint? Also, do you have the latest video card drivers? I've had repainting issues in WPF with some older drivers that were corrected with newer ones. – user7116 Jul 05 '11 at 19:35
  • 4
    It is a threading bug triggered by the SystemEvents class. It generates the events on the wrong thread. This happens when the very first window that is created is not created on the main thread. Common with custom splash screens. – Hans Passant Jul 05 '11 at 20:15
  • @sixlettervariables: No, they are quite happy surviving the minimize/maximize cycle. – Jonathan Jul 06 '11 at 08:06

1 Answers1

2

Does you application update automatically (refresh) the list? I have seen control issues like this due to a high GDI object count caused by not correctly disposing some types of objects. Check Task Manager and go View -> Select Columns to specify USER objects and GDI objects and see if anything creeps up as the application goes on.

Any time I have also fixed strange control issues with a simple graphics card driver update, so might be worth checking you have the latest driver installed.

I supposed as this takes a while to occur it is a difficult one to bug. Actually, I just remembered I had a very strange issue a while back where you would get GUI bugs if you lock the desktop then unlock. Give that a try to see if you can replicate the issue on demand

musefan
  • 47,875
  • 21
  • 135
  • 185
  • It does indeed. I suspect that this is most likely the answer. Sadly, I no longer have access to the application (or the code), so I cannot check, but this sounds like it is the most promising approach. – Jonathan Oct 12 '11 at 09:05