TrackBar
-
Hello, I am working on my final project at the university. I need a .net TrackBar or a similar control to set an upper-limit, a lower-limit and a setting value. Could somebody help me? :confused: Thank you so much.
Nicolás.
-
Hello, I am working on my final project at the university. I need a .net TrackBar or a similar control to set an upper-limit, a lower-limit and a setting value. Could somebody help me? :confused: Thank you so much.
Nicolás.
-
Thanks for your answer Calla, I all ready saw that page. But that control only have one slider. Do you know if there is a similar control with 3 sliders? Tranks again.
Nicolás.
-
Thanks for your answer Calla, I all ready saw that page. But that control only have one slider. Do you know if there is a similar control with 3 sliders? Tranks again.
Nicolás.
There aren't any in-built ones. Search for .NET Range controls and you may find something that suits. If not, it's fairly easy to code your own if it's only for one type of value such as an int.
Dave
If this helped, please vote & accept answer!
Binging is like googling, it just feels dirtier. (Pete O'Hanlon)
BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn) -
There aren't any in-built ones. Search for .NET Range controls and you may find something that suits. If not, it's fairly easy to code your own if it's only for one type of value such as an int.
Dave
If this helped, please vote & accept answer!
Binging is like googling, it just feels dirtier. (Pete O'Hanlon)
BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)Hello Dave. Yes, it is for one type of values. Do you have some example or a reference?
Nicolás.
-
Hello Dave. Yes, it is for one type of values. Do you have some example or a reference?
Nicolás.
I don't unfortunately. I did code one myself a while ago but never used it in the end - I'll have a dig through my backups at home and see if I can find it but it may take me a day or two to locate it.
Dave
If this helped, please vote & accept answer!
Binging is like googling, it just feels dirtier. (Pete O'Hanlon)
BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn) -
Hello Dave. Yes, it is for one type of values. Do you have some example or a reference?
Nicolás.
Perhaps you could modify this code[^] and add a value property?
Dave
If this helped, please vote & accept answer!
Binging is like googling, it just feels dirtier. (Pete O'Hanlon)
BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn) -
Hello Dave. Yes, it is for one type of values. Do you have some example or a reference?
Nicolás.
Hi, I've had a look through my files and I never completed it as it was no longer required. You are welcome to use what I did and finish it off if you'd like. The main things that need doing are marked // ToDo: - unfortunately that includes the painting and mouse handling - but the
Range
struct is pretty much complete and the main code for the control is in place.// Range.cs
using System;namespace DaveyM69
{
[Serializable]
public struct Range : IEquatable<Range>
{
// ToDo: Make struct designer friendly!public static readonly Range Empty = new Range(); public static readonly Range MaxRange = new Range(int.MinValue, int.MaxValue); public static readonly Range Percentage = new Range(0, 100); private int lower; private int upper; public Range(int lower, int upper) { if (lower > upper) { int newUpper = lower; lower = upper; upper = newUpper; } this.lower = lower; this.upper = upper; } public static bool operator ==(Range rangeA, Range rangeB) { return (rangeA.lower == rangeB.lower) && (rangeA.upper == rangeB.upper); } public static bool operator !=(Range rangeA, Range rangeB) { return !(rangeA == rangeB); } public int Lower { get { return lower; } } public int Upper { get { return upper; } } public Range Adjust(int offset) { return new Range(lower + offset, upper + offset); } public int Contain(int value) { return Contain(value, false); } public int Contain(int value, bool excludeExtremities) { Range testRange = excludeExtremities ? this.Expand(-1) : this; if (value < testRange.lower) return testRange.lower; if (value > testRange.upper) return testRange.upper; return value; } public Range Contain(Range range) { return Contain(range, false); } public Range Contain(Range range, bool excludeExtremities) { if (Contains(range, excludeExtremities)) return range; int newLower = range.lower;