Slider Control and redrawing problems.


David Glover

Hi all,

Firstly I apologise if this is the second time such a message appears,
IE died as I hit post :/

I have finally gotten around to starting my slider control which I
mentioned here. I immediatly mocked some code up to see if my inital
ideas of where the problems were going to lie were infact problems.
And they are!

My situation is:

I wrote some code which redraws the slider in the OnPaint method. This
was causing lots of 'flickering' when the slider (in this case a
simple elipse, however this may change to something nicer) was moved
along the bar. My inital idea was to have some logic to calculate the
area which needed redrawing (between the last position and new
position of the slider). This was then turned into a rectangle and
passed to this.Invalidate(...).

This however still left me with a significant ammount of flickering
around the elispse. My next thought was to create a bitmap and draw
onto that, and then at the end of the OnPaint method, simply call
graphicsInstance.DrawImage(...), however there is still a considerable
ammount of flickering around the elipse.

Please can anyone suggest another/better way to do this, or an
additional stage that I could use to remove this flickering effect
from the elipse.

Many thanks,



Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads