Salat Posted February 17, 2003 Posted February 17, 2003 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 Quote profesjonalne programowanie na zlecenie :)
*Gurus* divil Posted February 17, 2003 *Gurus* Posted February 17, 2003 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. Quote MVP, Visual Developer - .NET Now you see why evil will always triumph - because good is dumb. My free .NET Windows Forms Controls and Articles
Salat Posted February 17, 2003 Author Posted February 17, 2003 thanks it works... I used also your code http://www.xtremedotnettalk.com/showthread.php?s=&threadid=49659 It explains me a lot, thanks again Quote profesjonalne programowanie na zlecenie :)
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.