scroll a listbox

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Keltus

    #1

    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.Scrol l(e.Delta *
    WindowsScrollMu ltiplier); but unfortunately, there is no Scroll()
    member function for ListBox. So I seem to be stuck.

    Thanks,
  • DWinter

    #2
    Re: scroll a listbox

    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="d ocument.all.lis tboxid.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" <purplenachos@y ahoo.com> wrote in message
    news:b154a08b.0 308202051.44ff4 e4e@posting.goo gle.com...[color=blue]
    > 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.Scrol l(e.Delta *
    > WindowsScrollMu ltiplier); but unfortunately, there is no Scroll()
    > member function for ListBox. So I seem to be stuck.
    >
    > Thanks,[/color]


    Comment

    Working...