CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Mar 2000
    Location
    kingston, jamaica
    Posts
    8

    How do I make an item in a listview scroll into view?

    If I am searching for an item in a listview and it is out of view, how do I make it scroll into view and be at the top of the listview, just like the INDEX search in Windows Help?


  2. #2
    Join Date
    Jan 2000
    Location
    MO, USA
    Posts
    1,506

    Re: How do I make an item in a listview scroll into view?

    Try the EnsureVisible method of that item.

    Once you find the item you want to show call that method and it should do it.

    hope this helps,

    John

    John Pirkey
    MCSD
    http://www.ShallowWaterSystems.com
    http://www.stlvbug.org
    John Pirkey
    MCSD (VB6)
    http://www.stlvbug.org

  3. #3
    Join Date
    Mar 2000
    Location
    kingston, jamaica
    Posts
    8

    Re: How do I make an item in a listview scroll into view?

    I have already tried that, but it only works if the item is already in view.


  4. #4
    Join Date
    Nov 1999
    Posts
    31

    Re: How do I make an item in a listview scroll into view?

    Right Click the Listview and select properties.

    Set the following dropdown boxes to:
    MousePointer: 0-ccDefault
    View: 3-lvwReport
    Arrange: 0-lvwNone
    LabelEdit: 1-lvwManual
    Borderstyle: 1-ccFixedSingle
    Appearance: 1-cc3D
    OLEDragMode: 0-ccOLEDrarManual
    OLEDropMode: 0-ccOLEDropNone

    The following boxes should be checked:
    HideSelection
    LabelWrap
    Enabled
    FullRowSelect



    This is what I have in my project to get the scrollbars to scroll...


  5. #5
    Join Date
    Mar 2000
    Location
    kingston, jamaica
    Posts
    8

    Re: How do I make an item in a listview scroll into view?

    Thanks for the help, but that is not I am looking for. I want the item to be the first one at the top of the listview, just like when u type the VB Help Topics by INDEX in VB.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured