How to programmicly cause Listview to display its text from another line not in view 
Author Message
 How to programmicly cause Listview to display its text from another line not in view

Thanks Randy for that info on the listbox's right click

Was just wondering as listview compared to the listbox control
its a simple means to change the visual location of lines displayed

example
100 Items were added to a listbox, items 1-10 are being displayed and
Item 1 is selected the program does a

        list1.selected(15) = True

and the listbox scrolls down to display that line selected in view
now.

As opposed to the listview using the select does not seem to do that
is there an easy way of doing so.

Also I've noticed a big proformace degradation using the listview
control I realize that there are more features with it .

If I replace a line in the listbox control as follows

            fMainForm.List1.RemoveItem fMainForm.List1.ListCount - 1
            fMainForm.List1.AddItem (Format(XconRcn - 1, "000000") & "
* " & textline)
            fMainForm.List1.Selected((fMainForm.List1.ListCount - 1))
= True

its instantaneous as opposed to the listview control. When you do a
remove line with the listview you see all the lines following move up
they do that in the listbox control but very quickly, were it is not
noticeably

            Form1.ListView1.ListItems.Remove (x)
            Form1.ListView1.ListItems.Add(x) = ("A - " & holdlist)

then if you add a change of color for that line I can go have a cup of
coffee and a donuts before the movement stops.............

            Form1.ListView1.ListItems.Item(x).ForeColor = vbBlue
            Form1.ListView1.ListItems.Item(x).Bold = True

'This does not repositions the lines which I want

            Form1.ListView1.SelectedItem.Selected = true

'Nor this

        Form1.ListView1.ListItems(x).Selected = True    

Any suggestions

THX
John



Wed, 19 Jun 2002 03:00:00 GMT  
 How to programmicly cause Listview to display its text from another line not in view

Quote:
>example
>100 Items were added to a listbox, items 1-10 are being displayed and
>Item 1 is selected the program does a

>    list1.selected(15) = True

>and the listbox scrolls down to display that line selected in view
>now.

>As opposed to the listview using the select does not seem to do that
>is there an easy way of doing so.

John,

ListView1.SelectedItem.EnsureVisible

or

ListView1.ListItems(x).EnsureVisible

Mattias

________________________________________________
Mattias "beezo" Sj?gren, MCP

http://home1.2.sbbs.se/mattias.sjogren/sw/
Please send questions/replies to the newsgroups



Wed, 19 Jun 2002 03:00:00 GMT  
 How to programmicly cause Listview to display its text from another line not in view
John,

I have found that setting the Listview visibility to False while loading
helps performance.

Listview1.Visible = False
...Load the listview
Listview1.Visible = True

Cheers,
Larry Rebich


www.buygold.net


Quote:
> Thanks Randy for that info on the listbox's right click

> Was just wondering as listview compared to the listbox control
> its a simple means to change the visual location of lines displayed

> example
> 100 Items were added to a listbox, items 1-10 are being displayed and
> Item 1 is selected the program does a

> list1.selected(15) = True

> and the listbox scrolls down to display that line selected in view
> now.

> As opposed to the listview using the select does not seem to do that
> is there an easy way of doing so.

> Also I've noticed a big proformace degradation using the listview
> control I realize that there are more features with it .

> If I replace a line in the listbox control as follows

>             fMainForm.List1.RemoveItem fMainForm.List1.ListCount - 1
>             fMainForm.List1.AddItem (Format(XconRcn - 1, "000000") & "
> * " & textline)
>             fMainForm.List1.Selected((fMainForm.List1.ListCount - 1))
> = True

> its instantaneous as opposed to the listview control. When you do a
> remove line with the listview you see all the lines following move up
> they do that in the listbox control but very quickly, were it is not
> noticeably

>             Form1.ListView1.ListItems.Remove (x)
>             Form1.ListView1.ListItems.Add(x) = ("A - " & holdlist)

> then if you add a change of color for that line I can go have a cup of
> coffee and a donuts before the movement stops.............

>             Form1.ListView1.ListItems.Item(x).ForeColor = vbBlue
>             Form1.ListView1.ListItems.Item(x).Bold = True

> 'This does not repositions the lines which I want

>             Form1.ListView1.SelectedItem.Selected = true

> 'Nor this

> Form1.ListView1.ListItems(x).Selected = True

> Any suggestions

> THX
> John



Wed, 19 Jun 2002 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Data not displaying in multi-line text box

2. VB ListView Control - How to just display column lines - no row lines

3. PBM: Line numbers used by Goto method do not reflect displayed line numbers in document

4. Listview problem - Setting the current line to display

5. LISTVIEW - multi line Display

6. Display multiple lines of text (memo)?

7. WANTED: copy of VBX that can display pictures and multi-line text

8. Line Control Does not Display on Some Windows 2000 Machines

9. Color in Listview Subitem does not display correctly

10. Line Control Does not Display on Some Windows 2000 Machines

11. ListView - select item, display related text in a Label

12. Line Control Does not Display on Some Windows 2000 Machines

 

 
Powered by phpBB® Forum Software