listview autoscroll event?

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

    listview autoscroll event?

    How do i detect that the vertical scroll bar has been
    moved and how do i get the vertical scrollbar value from
    a listview. I need to do this to synchronise a textbox
    movement within the listview.
  • Nicholas Paldino [.NET/C# MVP]

    #2
    Re: listview autoscroll event?

    Ashley,

    You will have to create a class that derives from ListView. In this
    class, you will have to override the WndProc method and process the
    WM_VSCROLL or WM_HSCROLL messages. The scrollbars send this to the ListView
    in order to indicate that the scroll has been moved.

    When processing that message, you can move the other windows
    appropriately. Also, you can call the GetScrollInfo API function through
    the P/Invoke layer to get the appropriate information about the standard
    scroll bars for a window (using the handle for the ListView control).

    Hope this helps.


    --
    - Nicholas Paldino [.NET/C# MVP]
    - mvp@spam.guard. caspershouse.co m

    "ashley" <anonymous@disc ussions.microso ft.com> wrote in message
    news:56a601c3a9 0b$23e4afb0$7d0 2280a@phx.gbl.. .[color=blue]
    > How do i detect that the vertical scroll bar has been
    > moved and how do i get the vertical scrollbar value from
    > a listview. I need to do this to synchronise a textbox
    > movement within the listview.[/color]


    Comment

    • ashley

      #3
      Re: listview autoscroll event?

      Thanks Nicholas,

      Have you got any code examples. It would help!

      Ashley.
      [color=blue]
      >-----Original Message-----
      >Ashley,
      >
      > You will have to create a class that derives from[/color]
      ListView. In this[color=blue]
      >class, you will have to override the WndProc method and[/color]
      process the[color=blue]
      >WM_VSCROLL or WM_HSCROLL messages. The scrollbars send[/color]
      this to the ListView[color=blue]
      >in order to indicate that the scroll has been moved.
      >
      > When processing that message, you can move the other[/color]
      windows[color=blue]
      >appropriatel y. Also, you can call the GetScrollInfo API[/color]
      function through[color=blue]
      >the P/Invoke layer to get the appropriate information[/color]
      about the standard[color=blue]
      >scroll bars for a window (using the handle for the[/color]
      ListView control).[color=blue]
      >
      > Hope this helps.
      >
      >
      >--
      > - Nicholas Paldino [.NET/C# MVP]
      > - mvp@spam.guard. caspershouse.co m
      >
      >"ashley" <anonymous@disc ussions.microso ft.com> wrote in[/color]
      message[color=blue]
      >news:56a601c3a 90b$23e4afb0$7d 02280a@phx.gbl. ..[color=green]
      >> How do i detect that the vertical scroll bar has been
      >> moved and how do i get the vertical scrollbar value[/color][/color]
      from[color=blue][color=green]
      >> a listview. I need to do this to synchronise a textbox
      >> movement within the listview.[/color]
      >
      >
      >.
      >[/color]

      Comment

      Working...