469,290 Members | 1,882 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,290 developers. It's quick & easy.

MouseWheel & ScrollBars

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
7 19750
-----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
"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
"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
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
"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
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
"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.

Similar topics

6 posts views Thread by deko | last post: by
reply views Thread by Jordi Rico | last post: by
1 post views Thread by Nicholas Shewmaker | last post: by
3 posts views Thread by Dave K | last post: by
reply views Thread by WaterWalk | last post: by
1 post views Thread by =?Utf-8?B?UmljaA==?= | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.