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

scroll a listbox

P: n/a
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
Share this Question
Share on Google+
1 Reply


P: n/a
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.