468,115 Members | 2,063 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,115 developers. It's quick & easy.

How to stop onPaint events from being triggered

Dear all,

This prblem is bothering me quite some time now... I have a Panel with
a custom panels on top of iet on top of it. Now I need do perform some
updates on all of the (15+). Understandably, all the small updates cause
the OnPaint method to be called for the different Panel *and* for the
containing Panel. However, I want all results to be displayed at once.
In other words, how can I wait for all subpanels to be drawn, before
displaying the results.

Double buffering is activated on all components with:
this.SetStyle(ControlStyles.AllPaintingInWmPaint|C ontrolStyles.DoubleBuffer|ControlStyles.UserPaint, true);
As an example:
I have a Panel with on top of that:
- Panel1: Graphics.DrawText(this.sometext,......); in the OnPaint methods
- Panel2: Graphics.DrawText(this.sometext,......); in the OnPaint methods
- Panel3: Graphics.DrawText(this.sometext,......); in the OnPaint methods
- Panel4: Graphics.DrawText(this.sometext,......); in the OnPaint methods
- Panel5: Graphics.DrawText(this.sometext,......); in the OnPaint methods

now I have a routine that modifies all the sometext values for all the Panel1-5
This gives ma

Panel1 repaints --> OnPaint is called and performed on Panel1, OnPaint is performed for the region of Panel1 in the containing Panel
Panel1 is refreshed on screen
Panel2 repaints --> OnPaint is called and performed on Panel2, OnPaint is performed for the region of Panel2 in the containing Panel
Panel2 is refresh on screen
and so on...

I want:
Panel1 has changed some text
<optionally Panel1 is refreshed *off* screen>
Panel2 has changed some text
<optionally Panel2 is refreshed *off* screen>
Panel3 has changed some text
<optionally Panel3 is refreshed *off* screen>
.....
the containing Panel is refreshed and all updates are done at once
I must add a double buffer somewhere; but I don't know where exactly nor how.
Any help is appreciated!
Kind regards,
SirThanxALot
Nov 29 '05 #1
0 1282

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

8 posts views Thread by Mark Johnson | last post: by
1 post views Thread by Natalia DeBow | last post: by
3 posts views Thread by Stampede | last post: by
7 posts views Thread by Neal Andrews | last post: by
14 posts views Thread by raylopez99 | last post: by
8 posts views Thread by Rex the Strange | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.