Repaint order of invalidated child controls
- From: Max Bolingbroke <mb566{n0@sp4m}cam.ac.uk>
- Date: Fri, 20 Oct 2006 08:50:37 +0100
Hi,
I'm developing a hex editor control, and it displays the hex and raw views into the document using a number of subcontrols. This is great, but now I'm seeing a bug when I scroll my control very fast.
How it should look:
http://www.omega-prime.co.uk/files/invalidate-desired.png
How it does look:
http://www.omega-prime.co.uk/files/invalidate-bug.png
Since scrolling the control forces all the subcontrols to invalidate, and they repaint separately, it can occur that they get out of sync on screen (in this case, the selection is clearly different for each control). This, however, would be OK if I could just get Windows to redraw the least recently repainted control first (the flicker would become unnoticable).
The problem is that this doesn't seem to be possible. The order in which I issue Control.Invalidate calls is irrelevant! For example:
INVALIDATE TextAdapter
INVALIDATE SeparatorAdapter
INVALIDATE HexAdapter
INVALIDATE SeparatorAdapter
INVALIDATE AddressAdapter
PAINT AddressAdapter
PAINT SeparatorAdapter
PAINT HexAdapter
PAINT SeparatorAdapter
PAINT TextAdapter
This can lead to situations like this (when scrolling fast):
INVALIDATE AddressAdapter // Scrolled for the first time, invalidate everything
INVALIDATE SeparatorAdapter
INVALIDATE HexAdapter
INVALIDATE SeparatorAdapter
INVALIDATE TextAdapter
PAINT AddressAdapter // Windows starts to paint...
INVALIDATE AddressAdapter // Scrolled again, only invalidate what needs redrawing in a vain hope that repaints work as a queue
PAINT AddressAdapter // Windows starts to paint again, but not as a queue, so e.g. AddressAdapter is always redrawn with top priority, leading to the bug
PAINT SeparatorAdapter
PAINT HexAdapter
PAINT SeparatorAdapter
PAINT TextAdapter
So, is there a clean way to make invalidate events occur in order? Or is there a better way to handle this graphical bug?
Thanks in advance!
Max
.
- Prev by Date: Re: How to set a C # form never be focused?
- Next by Date: Re: Vb program stopped working
- Previous by thread: .net 3.0: transparent windows?
- Next by thread: on datagridview row selection...
- Index(es):
Relevant Pages
|