Listview next item 
Author Message
 Listview next item

Hoi,

How can I select the next item in a listview (with code not with the mouse )

Jan



Thu, 27 Jan 2005 18:24:32 GMT  
 Listview next item
Select as in "highlight"?  Next item from what? And while retaining the
current selection as well (multiselect)?  Please elaborate a bit more.

--

Randy Birch
MVP Visual Basic
http://www.mvps.org/vbnet/
Please respond only to the newsgroups so all can benefit.


| Hoi,
|
| How can I select the next item in a listview (with code not with the
mouse )
|
| Jan
|
|



Thu, 27 Jan 2005 21:23:43 GMT  
 Listview next item
Yes Select (highlight) the next item in the listview there is no multiselect



Quote:
> Select as in "highlight"?  Next item from what? And while retaining the
> current selection as well (multiselect)?  Please elaborate a bit more.

> --

> Randy Birch
> MVP Visual Basic
> http://www.mvps.org/vbnet/
> Please respond only to the newsgroups so all can benefit.



> | Hoi,
> |
> | How can I select the next item in a listview (with code not with the
> mouse )
> |
> | Jan
> |
> |



Thu, 27 Jan 2005 21:45:03 GMT  
 Listview next item
off the top of my head ...

   With ListView1

      If .SelectedItem.index < .ListItems.Count Then

            .ListItems(.SelectedItem.index).Selected = False
            .ListItems(.SelectedItem.index + 1).Selected = True
            .ListItems(.SelectedItem.index).EnsureVisible
      End If

   End With

--

Randy Birch
MVP Visual Basic
http://www.mvps.org/vbnet/
Please respond only to the newsgroups so all can benefit.


| Yes Select (highlight) the next item in the listview there is no
multiselect
|


| > Select as in "highlight"?  Next item from what? And while retaining the
| > current selection as well (multiselect)?  Please elaborate a bit more.
| >
| > --
| >
| > Randy Birch
| > MVP Visual Basic
| > http://www.mvps.org/vbnet/
| > Please respond only to the newsgroups so all can benefit.
| >
| >


| > | Hoi,
| > |
| > | How can I select the next item in a listview (with code not with the
| > mouse )
| > |
| > | Jan
| > |
| > |
| >
| >
|
|



Thu, 27 Jan 2005 22:34:01 GMT  
 Listview next item
Thanks,

My Idee was that the index only was used for a array control

Jan


Quote:
> off the top of my head ...

>    With ListView1

>       If .SelectedItem.index < .ListItems.Count Then

>             .ListItems(.SelectedItem.index).Selected = False
>             .ListItems(.SelectedItem.index + 1).Selected = True
>             .ListItems(.SelectedItem.index).EnsureVisible
>       End If

>    End With

> --

> Randy Birch
> MVP Visual Basic
> http://www.mvps.org/vbnet/
> Please respond only to the newsgroups so all can benefit.



> | Yes Select (highlight) the next item in the listview there is no
> multiselect
> |


> | > Select as in "highlight"?  Next item from what? And while retaining
the
> | > current selection as well (multiselect)?  Please elaborate a bit more.
> | >
> | > --
> | >
> | > Randy Birch
> | > MVP Visual Basic
> | > http://www.mvps.org/vbnet/
> | > Please respond only to the newsgroups so all can benefit.
> | >
> | >


> | > | Hoi,
> | > |
> | > | How can I select the next item in a listview (with code not with the
> | > mouse )
> | > |
> | > | Jan
> | > |
> | > |
> | >
> | >
> |
> |



Fri, 28 Jan 2005 05:58:04 GMT  
 Listview next item
If there's no multi-select you can use:

If List1.Listindex < List1.Listcount -1 then
    List1.Listindex = List1.Listindex + 1
end if


Quote:
> Yes Select (highlight) the next item in the listview there is no
multiselect



> > Select as in "highlight"?  Next item from what? And while retaining the
> > current selection as well (multiselect)?  Please elaborate a bit more.

> > --

> > Randy Birch
> > MVP Visual Basic
> > http://www.mvps.org/vbnet/
> > Please respond only to the newsgroups so all can benefit.



> > | Hoi,
> > |
> > | How can I select the next item in a listview (with code not with the
> > mouse )
> > |
> > | Jan
> > |
> > |



Fri, 28 Jan 2005 10:13:55 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. Show data when next item is selected in listview object

2. Show data when next item is selected in listview object

3. next item and previous item?

4. How to do Next item and Previous item programatically

5. jump listview to the hilight item (selected item)...

6. Any Way To Stop All ListView Items From Blinking While Adding Items

7. Drag an item of Listview to another position of the same ListView

8. Listview: check if an item in current listview

9. changing the background of a listview item in the listview control

10. Listview Control - moving items from one listview to another

11. Listview - Changing color of listview items

12. Inspector Next Item

 

 
Powered by phpBB® Forum Software