scroll a listbox

  • Thread starter Thread starter Keltus
  • Start date Start date
K

Keltus

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,
 
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top