Click here to Skip to main content
15,922,584 members
Home / Discussions / C#
   

C#

 
GeneralRe: Limiting the bandwidth Pin
pi_trek10-Jul-04 3:54
pi_trek10-Jul-04 3:54 
GeneralRe: Limiting the bandwidth Pin
Dave Kreskowiak10-Jul-04 5:39
mveDave Kreskowiak10-Jul-04 5:39 
GeneralRe: Limiting the bandwidth Pin
pi_trek10-Jul-04 8:04
pi_trek10-Jul-04 8:04 
GeneralI would like to add programmatically a new element(c# or VB.NET) in the header of my aspx page. Pin
zoltix9-Jul-04 0:25
zoltix9-Jul-04 0:25 
GeneralRe: I would like to add programmatically a new element(c# or VB.NET) in the header of my aspx page. Pin
Colin Angus Mackay9-Jul-04 2:14
Colin Angus Mackay9-Jul-04 2:14 
GeneralRe: I would like to add programmatically a new element(c# or VB.NET) in the header of my aspx page. Pin
zoltix9-Jul-04 2:31
zoltix9-Jul-04 2:31 
GeneralDouble buffering Pin
Atlemann8-Jul-04 23:59
Atlemann8-Jul-04 23:59 
GeneralRe: Double buffering Pin
Heath Stewart9-Jul-04 4:18
protectorHeath Stewart9-Jul-04 4:18 
First of all, the ControlStyles enumeration is flagged (attributed with the FlagsAttribute), meaning that you can use bitwise operators on it. In the Microsoft .NET BCL assemblies (base class library), any enumeration with a plural ending does (the power of naming conventions and consistency).

You can save many instructions by changing the three lines to the following:
SetStyle(ControlStyles.UserPaint | ControlStyles.DoubleBuffer
  | ControlStyles.AllPaintingInWmPaint, true);
This has to be called before the handle is created, so it's best you do this in the constructor.

Second, double-buffering isn't a blanket fix for any drawing problems. More than likely, the entire graph area is being invalidated or your redrawing the entire graph every time OnPaint is called (or your Paint event handler, which ever way you're doing it - although overriding OnPaint is faster and gives you greater control).

Instead of drawing the entire region, use the PaintEventArgs.ClipRectangle passed to the OnPaint method to determine which area needs repainting. If you repaint the entire area for a complex drawing (like a graph), double-buffering will not help much (a little, but not much).

 

Microsoft MVP, Visual C#
My Articles
General2D Array modification Pin
saud_a_k8-Jul-04 23:59
saud_a_k8-Jul-04 23:59 
GeneralRe: 2D Array modification Pin
Heath Stewart9-Jul-04 3:57
protectorHeath Stewart9-Jul-04 3:57 
GeneralRe: 2D Array modification Pin
saud_a_k12-Jul-04 18:21
saud_a_k12-Jul-04 18:21 
GeneralRe: 2D Array modification Pin
saud_a_k12-Jul-04 21:32
saud_a_k12-Jul-04 21:32 
QuestionHow to add a button in the caption bar of a window Pin
bouli8-Jul-04 22:11
bouli8-Jul-04 22:11 
AnswerRe: How to add a button in the caption bar of a window Pin
Anonymous9-Jul-04 1:37
Anonymous9-Jul-04 1:37 
GeneralRe: How to add a button in the caption bar of a window Pin
saud_a_k9-Jul-04 2:02
saud_a_k9-Jul-04 2:02 
AnswerRe: How to add a button in the caption bar of a window Pin
Heath Stewart9-Jul-04 3:52
protectorHeath Stewart9-Jul-04 3:52 
GeneralRe: How to add a button in the caption bar of a window Pin
bouli9-Jul-04 3:56
bouli9-Jul-04 3:56 
GeneralRe: How to add a button in the caption bar of a window Pin
Heath Stewart9-Jul-04 4:38
protectorHeath Stewart9-Jul-04 4:38 
GeneralRe: How to add a button in the caption bar of a window Pin
bouli9-Jul-04 4:45
bouli9-Jul-04 4:45 
GeneralSending multiple values(Array) from one page to other Pin
Member 11955128-Jul-04 21:14
Member 11955128-Jul-04 21:14 
GeneralRe: Sending multiple values(Array) from one page to other Pin
Heath Stewart9-Jul-04 3:29
protectorHeath Stewart9-Jul-04 3:29 
GeneralDynamiclly naming variables Pin
saud_a_k8-Jul-04 20:45
saud_a_k8-Jul-04 20:45 
GeneralRe: Dynamiclly naming variables Pin
etfintnick8-Jul-04 23:04
etfintnick8-Jul-04 23:04 
GeneralRe: Dynamiclly naming variables Pin
etfintnick8-Jul-04 23:06
etfintnick8-Jul-04 23:06 
GeneralRe: Dynamiclly naming variables Pin
etfintnick8-Jul-04 23:08
etfintnick8-Jul-04 23:08 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.