locked
Using Trackbar RRS feed

  • Question

  • Hello,

     

    I'm trying to do something usefull with a TrackBar. First of all I needed to create my own implementation of a trackbar (MyTrackBar : TrackBar) because i wanted to place some labels under the trackBar ( this is not possible with the standard TrackBar ??? )

     

    Now I need to do something usefull with the value of the TrackBar when it has changed. In my case I have to send this value to another PC who has to confirm this value (the second PC can also send a message that the value has changed due to another event, so I always need to listen for this information).

     

    If you change the value with the mouse, I only need to send the final value, (so don't need to send every value). There is no event for this in the Trackbar, i could try to use the MouseCaptureChanged event which is fired when you have changed the Value with the mouse and then release the mouse but this does not work if you use the keyboard instead of the mouse.

     

    Anybody a suggestion?

     

    Monday, November 19, 2007 4:36 PM

Answers

  • I think they assume that placing labels on your parent control under the trackbar control would be sufficient. I think your problem depends on how you define the final value. You could listen to the mouse down and key down events, and if those events are trigering value changes set a flag. Then on the mouse up and key up events, if the flag is set, fire your own event to indicate that the user is finished changing the values.

    Monday, November 19, 2007 6:18 PM