Adding MouseUp for Slider

VoiD

New member
Joined
Jul 27, 2005
Messages
1
Programming Experience
Beginner
Hello all,

This is my first time to these forums, so be nice
smile.gif


I've been trying this problem for a while, and just can't get around it.

I want to add an event that will be raised when the mouse is released on my hscrollbar. I've tried creating a custom control, but do not have much experience. This is what I have so far:
VB.NET:
 [color=#00007f]Public[/color] [color=#00007f]Class[/color] xtScroll

    [color=#00007f]Inherits[/color] System.Windows.Forms.HScrollBar

    [color=#00007f]Public[/color] [color=#00007f]Shadows[/color] [color=#00007f]Event[/color] MouseUp [color=#00007f]As[/color] MouseEventHandler

    [color=#00007f]Protected[/color] [color=#00007f]Overrides[/color] [color=#00007f]Sub[/color] OnMouseUp([color=#00007f]ByVal[/color] e [color=#00007f]As[/color] System.Windows.Forms.MouseEventArgs)

        [color=#00007f]RaiseEvent[/color] MouseUp([color=#00007f]Me[/color], e)

    [color=#00007f]End[/color] [color=#00007f]Sub[/color]

[color=#00007f]End[/color] Class
And then on my form where the scroll bar is used:
VB.NET:
 [color=#00007f]Sub[/color] xtScrollBar_MouseUp([color=#00007f]ByVal[/color] sender [color=#00007f]As[/color] [color=#00007f]Object[/color], [color=#00007f]ByVal[/color] e [color=#00007f]As[/color] MouseEventArgs) [color=#00007f]Handles[/color] XtScroll1.MouseUp

        MessageBox.Show("Mouse released")

    [color=#00007f]End[/color] Sub[/indent]
However, this does not work, so I'm turning to you guys
smile.gif


Any help is greatly appreciated.

Cheers,

Adam​
 
What are you trying to accomplish (the big picture)?
Perhaps you could use either the Scroll or ValueChanged events of the HScrollBar.
 
Back
Top