473,473 Members | 2,122 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

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 1490

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

Similar topics

8
by: Mark Johnson | last post by:
Using: VS 2003 NET C# for Framework and Framework Compact Trying : Moving a Card (Bitmap) as in Solitare (PC + WinCe) Version on OnMouseMove Problem : The affected drawing Area by Invalidate (or...
1
by: Natalia DeBow | last post by:
Hi, I am working on a Windows-based client-server application. I am involved in the development of the remote client modules. I am using asynchronous delegates to obtain information from...
3
by: Stampede | last post by:
Hi, I want to use the FileSystemWatcher in a Windows Service. I read an article, where the author created the FileSystemWatcher object in a seperate thread and when the event is fired, he started...
7
by: Neal Andrews | last post by:
Hi All, Does anyone know how to stop Events from being serialized in a class that uses the <Serializable()> attribute? I have tried using the <NonSerialized()> attribute but for some bizarre...
4
by: RSH | last post by:
How do I go about overriding a Control's OnPaint Method? I would like to prevent a control's color from changing when it is disabled. I have overridden the Form's OnPaint Method but I need to...
4
by: grayaii | last post by:
Hi, I have a simple form that handles all its paint functionality like so: this.SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.Opaque, true); And the entry point to this...
1
by: sean | last post by:
I'm trying to create "rubber-band" rectangles by overriding the OnPaint method to place rectangles on top of all graphic controls, but when I call Me.Invalidate() (when the user moves the mouse),...
14
by: raylopez99 | last post by:
KeyDown won't work KeyPress fails KeyDown not seen inspired by a poster here:http://tinyurl.com/62d97l I found some interesting stuff, which I reproduce below for newbies like me. The main...
8
by: Rex the Strange | last post by:
Hello All, I don't know if this is possible, but I'll give it a shot, here. I'm sick of writing the following line of code in control event handlers: if not visible then exit sub Is it...
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...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.