flashing text

Salat

Regular
Joined
Mar 5, 2002
Messages
81
Location
Poland, Silesia
I'm useing this code:
Code:
Private Sub TimerCi±g³e_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TimerCi±g³e.Tick
        Dim g As Graphics = PictureBox1.CreateGraphics()
        Dim Brusz As Brush = New SolidBrush(PictureBox1.ForeColor)
        g.Clear(PictureBox1.BackColor)
        NotCi±g³ePosuw = NotCi±g³ePosuw - 2
        LabW.Text = NotCi±g³eStream
        LabW.Refresh()
        If NotCi±g³ePosuw < -LabW.Width Then NotCi±g³ePosuw = PictureBox1.Width : NotCi±g³eStream = "some text"
        g.DrawString(NotCi±g³eStream, LabW.Font, Brusz, NotCi±g³ePosuw, 2))
    End Sub

It's main role is to role "some text" till it gone out of picturebox1 and then show it at the next edge. This code works fine, but it's flashing... Is there any way to make it role fluently... I've tried with qualitymode, but it didn't helped... any ideas would be great...

thanks for help... Piotrek
 
You will need to inherit from a control (a panel control ideally) and enable the built in double-buffering. Do this using the protected method SetStyle. Then instead of drawing in the timer tick, invalidate the control instead and do all drawing in the Paint event of the panel. This will prevent any flickering.
 
Back
Top