473,320 Members | 1,993 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Help repositioning listview item

Using VB6

I would like to reposition a selected item in listview (report mode) to the
top of the view. For a listbox, I was able to do the following:

'Move the selected URL to the top of the list box

If lstURLs.ListItems.Count - lstURLs.ListIndex >= 54 Then

lstURLs.TopIndex = lstURLs.ListIndex

End If

Where 54 is the number of rows displayed in the listbox. TopIndex can both
get and set the top item.

Is there a way of doing the same in a listview? I can get the top item with
GetFirstVisible.Index but the best I've been able to do is ensure visibility
with ListItems(selected).EnsureVisible. However, this does not reposition
the selected row to the top. Basically looking for a "SetFirstVisible.Index"

Thanks
Sep 23 '08 #1
0 1255

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Jiten | last post by:
Hi Cor I spoke with u previously about this problem i had and u gave me some code that helped me. That code worked fine but i have now encountered another issuee that im hoping u may know how to...
6
by: VM | last post by:
How can I fill up a listview with text file contents? My listview has two columns and the first column fills up with a while loop: while (myString != null) { myString = sr.Readline();...
2
by: Norfy | last post by:
As my first project in C# (after 'Hello World') I am trying to add a ListView to a Form so that it behaves like the 'LargeIcon' view in a Windows Explorer. ie. a ListViewItem can be dragged and...
0
by: Martin Streller | last post by:
Hello, The code below represents a simple ownerdrawn, Listview class in C#. Its purpose is to avoid the flicker of the MS ListView. So I can't fall back to their one. Does anybody know why I...
9
by: Devron Blatchford | last post by:
Hi there, Just wondering if I change the back and fore colour of a listview item when the mouse hovers over it? I want to overide the default windows colour. Can someone please tell me how to...
3
by: Larry | last post by:
I've set up a list of image filesnames in a listview control(lvSrcFileList), I'm using the selectedIndexChange event to select which file is being displayed in a picturebox control(pbImagePreview)....
7
by: Ronald S. Cook | last post by:
Thanks for reading this... Our current Win app employs a ListView control wherein the tag for an item is, for example, "ContentManager.DataModel.PowerPointContent". The following code exists...
1
by: samoore33 | last post by:
I found this code on MSDN, and it works great. It creates a ListView dynamically and add items to it and all. It is great. I have changed a few of the column names to suit me. Dim listView1 As...
6
by: Brandon McCombs | last post by:
Hello, I have a form that contains a listview on the left side and a column of buttons on the right side. Only some of the buttons do I want enabled all the time. The other buttons should be...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.