Hi,
I´m trying to draw a rectangle, for example, in a Form.
I do the following:
public graphic as Graphics
in the Form_Load I do:
graphic = Me.CreateGraphics
Me.SetStyle(ControlStyles.DoubleBuffer, True)
Me.SetStyle(ControlStyles.UserPaint, True)
Me.SetStyle(ControlStyles.AllPaintingInWmPaint, True)
in the Timer_Tick I do:
For i = 0 to 100
graphic.Clear(Color.White)
graphic.FillRectangle(Brushes.Blue, 0, 0, 50, 50)
Next
I want the rectangle to move without flickering the image, but I can´t avoid the flickering.
What am I doing wrong?
thanks,
Juliano.