472,962 Members | 2,386 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,962 software developers and data experts.

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,
Nov 29 '05 #1
0 1437

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

Similar topics

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...
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...
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...
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...
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...
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...
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),...
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...
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...
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

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.