65.9K
CodeProject is changing. Read more.
Home

Skin based slider control Mark 2

starIconstarIconstarIconstarIcon
emptyStarIcon
starIcon

4.36/5 (7 votes)

Jun 26, 2002

CPOL
viewsIcon

90935

downloadIcon

4747

Here's a recoding of aeropriest's skinned slide control.

Sample Image - Demo.jpg

Introduction

Needing a flexible slider control, I looked on CodeProject and found aeropriest Skin based slider control ( aeropriest's Article). As is often the case, the ideas where very good but the code contained a few bugs. I downloaded the code, fixed a few problems and here is the result.

The main changes are:-

  • Slider follows mouse when dragged correctly.
  • Slider is redrawn correctly.
  • Slider changes bitmap when dragged.
  • Back ground can be drawn dynamically.
  • Back ground can be centered/stretched to correct size.
  • Code tidied up.

For usage and other information see the original article. (aeropriest's article)

Change history

  • 27/6/02
    • Fixed a small bug with the bitmap's color depth
    • Changed the second sliders color to make it more obvious what is going on
    • Tidied zip file
  • 29/6/02
    • Added tooltips when dragging slider
    • Rewrote drawing code
  • 2/9/02
    • Added vertical sliders
    • Added SetPos()
    • Reduced flickering

I don't plan any more changes to this article.