D
DraguVaso
Hi,
To get faster performance of my DataGrid during scrolling I wanted to build
a timer in the Paint-event that waited some milli-seconds to Paint and
cancelled the method in case it received a new Paint (during scrolling).
But it doesn't seem to work :-(
The whole screen becomes empty, and when I look into the PaintEventArgs it
returns several errors (for exemple: ?petmr.Graphics.Clip -> <error: an
exception of type: {System.ArgumentException} occurred>).
Does anybody knows a solution for this?
Thanks a lot in advance!
Pieter
This is my code:
Protected Overrides Sub OnPaint(ByVal pe As
System.Windows.Forms.PaintEventArgs)
'my override
'stop the timer
tmrPaint.Stop()
'store the PaintEventArgs
peTmr = pe
'restart the timer
tmrPaint.Start()
End Sub
Private Sub tmrPaint_Elapsed(ByVal sender As Object, ByVal e As
System.Timers.ElapsedEventArgs) Handles tmrPaint.Elapsed
'call my paint-method
SubOnPaint(peTmr)
End Sub
Private Sub SubOnPaint(ByVal pe As System.Windows.Forms.PaintEventArgs)
'do all the painting stuff with MyBase.Paint etc etc
End sub
To get faster performance of my DataGrid during scrolling I wanted to build
a timer in the Paint-event that waited some milli-seconds to Paint and
cancelled the method in case it received a new Paint (during scrolling).
But it doesn't seem to work :-(
The whole screen becomes empty, and when I look into the PaintEventArgs it
returns several errors (for exemple: ?petmr.Graphics.Clip -> <error: an
exception of type: {System.ArgumentException} occurred>).
Does anybody knows a solution for this?
Thanks a lot in advance!
Pieter
This is my code:
Protected Overrides Sub OnPaint(ByVal pe As
System.Windows.Forms.PaintEventArgs)
'my override
'stop the timer
tmrPaint.Stop()
'store the PaintEventArgs
peTmr = pe
'restart the timer
tmrPaint.Start()
End Sub
Private Sub tmrPaint_Elapsed(ByVal sender As Object, ByVal e As
System.Timers.ElapsedEventArgs) Handles tmrPaint.Elapsed
'call my paint-method
SubOnPaint(peTmr)
End Sub
Private Sub SubOnPaint(ByVal pe As System.Windows.Forms.PaintEventArgs)
'do all the painting stuff with MyBase.Paint etc etc
End sub