469,599 Members | 2,590 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

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

scroll a listbox

Hello,

I have a Form with a ListBox in it. I'd like to be able to scroll the
ListBox even when it's not in focus. ie. when i scroll the mousewheel
when my focus is on the form, I'd like the ListBox to scroll. Now,
there are two ways I would think would work. The first is if I can
resend the MouseEventArgs to the ListBox but there does not seen to be
a way to pass that event along. The second is if I could manually
scroll the ListBox when the Form sees the MouseEventArgs. I gues that
would require something like mylistbox.Scroll(e.Delta *
WindowsScrollMultiplier); but unfortunately, there is no Scroll()
member function for ListBox. So I seem to be stuck.

Thanks,
Nov 15 '05 #1
1 6589
the list box can't scroll unless it has focus.
however, you can capture the wheel event on the body and set focus to the
list box like,
<body onmousewheel="document.all.listboxid.focus();">

then whenever you are on the page, if you scroll with the mouse, the list
box will be given focus and the scrolling is possible.

"Keltus" <pu**********@yahoo.com> wrote in message
news:b1**************************@posting.google.c om...
Hello,

I have a Form with a ListBox in it. I'd like to be able to scroll the
ListBox even when it's not in focus. ie. when i scroll the mousewheel
when my focus is on the form, I'd like the ListBox to scroll. Now,
there are two ways I would think would work. The first is if I can
resend the MouseEventArgs to the ListBox but there does not seen to be
a way to pass that event along. The second is if I could manually
scroll the ListBox when the Form sees the MouseEventArgs. I gues that
would require something like mylistbox.Scroll(e.Delta *
WindowsScrollMultiplier); but unfortunately, there is no Scroll()
member function for ListBox. So I seem to be stuck.

Thanks,

Nov 15 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

6 posts views Thread by Adam Klobukowski | last post: by
2 posts views Thread by Tina | last post: by
2 posts views Thread by John | last post: by
7 posts views Thread by Lit | last post: by
reply views Thread by suresh191 | last post: by
4 posts views Thread by guiromero | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.