By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,673 Members | 1,268 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,673 IT Pros & Developers. It's quick & easy.

MouseWheel & ScrollBars

P: n/a
I've got a control with a scrollbar docked to the right-hand side. The
scrollbar works fine, I've got an event:

bottomControlVScroll.Scroll += new
ScrollEventHandler(HandleBottomThingScroll);

Which calls this.Invalidate() on my control, and all is good. However, the
MouseWheel does naff all. I understand this is probably because my mouse is
over my control, and not the scrollbar. How can I set the MouseWheel event
on my control to pass to the ScrollBar, where the .Value is updated, and my
control invalidated & repainted?

--
Daisy The Cow
Now playing: Ultrabeat - Pretty Green Eyes
Nov 13 '05 #1
Share this Question
Share on Google+
7 Replies


P: n/a
-----Original Message-----
I've got a control with a scrollbar docked to the right- hand side. Thescrollbar works fine, I've got an event:

bottomControlVScroll.Scroll += new
ScrollEventHandler(HandleBottomThingScroll);

Which calls this.Invalidate() on my control, and all is good. However, theMouseWheel does naff all. I understand this is probably because my mouse isover my control, and not the scrollbar. How can I set the MouseWheel eventon my control to pass to the ScrollBar, where the .Value is updated, and mycontrol invalidated & repainted?

--
Daisy The Cow
Now playing: Ultrabeat - Pretty Green Eyes


Make the MouseWheel event of your control, go to
your HandleBottomThingScroll() method.

I hope this help.....
Nov 13 '05 #2

P: n/a
"Daisy" <da***@nospam.oops> wrote in message
news:be**********@linux01.dannytuppeny.com...
I've got a control with a scrollbar docked to the right-hand side. The
scrollbar works fine, I've got an event:

<snip>

Scrap that, the wheel works now, I altered .Value depending on e.Delta :o)

Anyways, the only problem now, is that it only works while my mouse is over
the scrollbar, and not anywhere in my control. I even added:

this.MouseWheel += new MouseEventHandler(HandleBottomThingWheel);

In the Constructor, and it still doesn't work for the control :(
Any ideas?
--
Daisy The Cow
Now playing: Eminem - Lose Yourself
Nov 13 '05 #3

P: n/a
"Hector Yunier" <hm********@uci.cu> wrote in message
news:02****************************@phx.gbl...
Make the MouseWheel event of your control, go to
your HandleBottomThingScroll() method.

I hope this help.....


It does now:

bottomControlVScroll.Scroll += new
ScrollEventHandler(HandleBottomThingScroll);
bottomControlVScroll.MouseWheel += new
MouseEventHandler(HandleBottomThingWheel);
this.MouseWheel += new MouseEventHandler(HandleBottomThingWheel);

But the wheel still only works when over the scrollbar :-((
--
Daisy The Cow
Now playing: Flip & Fill - I Wanna Dance With Somebody
Nov 13 '05 #4

P: n/a
I am not sure if you have already tried this but, is there a way to hook
into MouseWheel notifications for the window (parent of the scrollbar)
instead of the scrollbar itself? Then you could simply forward the message
on to the scrollbar control.

"Daisy" <da***@nospam.oops> wrote in message
news:be**********@linux01.dannytuppeny.com...
"Daisy" <da***@nospam.oops> wrote in message
news:be**********@linux01.dannytuppeny.com...
I've got a control with a scrollbar docked to the right-hand side. The
scrollbar works fine, I've got an event: <snip>

Scrap that, the wheel works now, I altered .Value depending on e.Delta :o)

Anyways, the only problem now, is that it only works while my mouse is

over the scrollbar, and not anywhere in my control. I even added:

this.MouseWheel += new MouseEventHandler(HandleBottomThingWheel);

In the Constructor, and it still doesn't work for the control :(
Any ideas?
--
Daisy The Cow
Now playing: Eminem - Lose Yourself

Nov 13 '05 #5

P: n/a
"Trevor" <tb*****@s-s.com> wrote in message
news:Od**************@TK2MSFTNGP10.phx.gbl...
I am not sure if you have already tried this but, is there a way to hook into MouseWheel notifications for the window (parent of the scrollbar)
instead of the scrollbar itself? Then you could simply forward the message on to the scrollbar control.


How do I "forward" them on? I can't call MouseWheel directly?
--
Daisy The Cow
Now playing: Nothing
Nov 13 '05 #6

P: n/a
Try creating a composite control (if you're not already using) and
overriding the OnMouseWheel event. Do everything you need there. Works for
me.

[]'s,
Harkos

"Daisy" <da***@nospam.oops> escreveu na mensagem
news:be**********@linux01.dannytuppeny.com...
"Trevor" <tb*****@s-s.com> wrote in message
news:Od**************@TK2MSFTNGP10.phx.gbl...
I am not sure if you have already tried this but, is there a way to

hook
into MouseWheel notifications for the window (parent of the scrollbar)
instead of the scrollbar itself? Then you could simply forward the

message
on to the scrollbar control.


How do I "forward" them on? I can't call MouseWheel directly?
--
Daisy The Cow
Now playing: Nothing

Nov 13 '05 #7

P: n/a
"Harkos" <ha****@uol.com.br> wrote in message
news:Oi**************@tk2msftngp13.phx.gbl...
Try creating a composite control (if you're not already using) and
overriding the OnMouseWheel event. Do everything you need there. Works for
me.


It's ok, it already works. I've got a crŠppy Vaio mouse on this laptop,
along with a USB keyboard with it's own crŠppy drivers. Must be them, works
on every other pc :o)
--
Daisy The Cow
Now playing: Alice Deejay - Better Off Alone
Nov 13 '05 #8

This discussion thread is closed

Replies have been disabled for this discussion.