Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I'm useing this 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

  • *Gurus*
Posted
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.

MVP, Visual Developer - .NET

 

Now you see why evil will always triumph - because good is dumb.

 

My free .NET Windows Forms Controls and Articles

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...