We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

TrackBarEx Control Events

Hi,
I'm using the TrackBarEx control in my application.I need to trap Scroll event of it but there is no such event.
There is ValueChaged event instead,but this event is not completely suitable for my needs.
Does anybody can advise me how do I solve the problem?

Thank' a lot!



1 Reply

SS Sri Subhashini M Syncfusion Team November 9, 2007 06:24 AM UTC

Hi,

I was able to view the condition you have described here. It is not directly possible.

We have a customized class of TrackBarEx that extends to have a ScrollEvent whenever MouseDown/KeyDown is dover over the THUMB.

public class CustomizedTrackBarEx : TrackBarEx
{
protected override void OnKeyDown(KeyEventArgs e)
{
base.OnKeyDown(e);
if (e.KeyData == Keys.Left)
{
RaiseOnScrollChangeEvent(this.Value);
}
}

protected override void OnMouseClick(MouseEventArgs e)
{
base.OnMouseClick(e);
RaiseOnScrollChangeEvent(this.Value);
}
}

Then, add the custom event with the TrackbarEx control,

// creating Custom event
this.trackBarEx1.ScrollChangedValueEvent += new TrackBarScrollEventHanlder(trackBarEx1_ScrollChangedValueEvent);
// Declaration of the custom event
void trackBarEx1_ScrollChangedValueEvent(TrackBarExScrollEventArgs sample)
{
this.trackBarEx1.ButtonColor = Color.FloralWhite;
}

Please take a look at the sample and let me know if it helps.

http://websamples.syncfusion.com/samples/Tools.Windows/TrackBarExSample/main.htm

Regards,
Suba.



Loader.
Live Chat Icon For mobile
Up arrow icon