I've tried using a scroll bar as an alternative solution for this, but the thumb size is getting bigger whenever I lower the minimum and maximum value and it just doesn't look good.WPF will likely have a slider like that, or at least it will be easy enough to change its template to look like that.
WinForms may take some work to hide the thumb control that moves the slider. Alternatively, the scroll bar could just be adapted to hide the thumb.
jQuery UI will likely let you build one from one of its existing bar graphs.
Yes, I am trying to implement this in my WinForms application. I had to provide this information in the thread before creating it, sorry.With your response about the scrollbar, I assuming you are trying to implement this within your WinForms app. If this assumption is incorrectly, please tell us what your target platform is so that we don't waste time discussing/exploring options if the result will not be applicable.
private int sliderWidth;
private void pictureBox1_MouseMove(object sender, MouseEventArgs e)
{
if (Control.MouseButtons == MouseButtons.Left)
{
sliderWidth = e.X;
pictureBox1.Refresh();
}
}
private void pictureBox1_Paint(object sender, PaintEventArgs e)
{
var rct = pictureBox1.ClientRectangle;
rct.Inflate(-4, -4);
rct.Width = Math.Min(sliderWidth, rct.Width);
e.Graphics.FillRectangle(Brushes.Orange, rct);
}