944,198 Members | Top Members by Rank

Ad:
Mar 17th, 2005
0

Listview

Expand Post »
Hi there,
I am using a listview control. After populating the listview, I want my cursor to jump to the last row and make it visible. how can i do that using vb code.
thanks in advance

newvbguy
Similar Threads
Reputation Points: 13
Solved Threads: 3
Junior Poster in Training
NewVBguy is offline Offline
71 posts
since Mar 2005
Mar 17th, 2005
0

Re: Listview

I have a feeling you are going to need to use API calls, or possibly sendkeys. If you post the code or attach the project, I'll take a look at it, and see if I can't find a way to accomplish it.
Team Colleague
Reputation Points: 361
Solved Threads: 214
Taboo Programmer
Comatose is offline Offline
2,413 posts
since Dec 2004
Oct 13th, 2006
0

Re: Listview

Hello Friend!!!! Here is the solution....using EnsureVisible!! Try with this:


Private Sub Form_Load()
With ListView1
.View = lvwReport
.ColumnHeaders.Add , , "TEST"
.ListItems.Add 1, , "5"
.ListItems.Add 1, , "4"
.ListItems.Add 1, , "3"
.ListItems.Add 1, , "2"
.ListItems.Add 1, , "1"
Set .SelectedItem = .ListItems(1)
.SelectedItem.EnsureVisible
End With
End Sub
Reputation Points: 10
Solved Threads: 0
Newbie Poster
totigo is offline Offline
1 posts
since Oct 2006
Dec 25th, 2006
0

Re: Listview

Click to Expand / Collapse  Quote originally posted by totigo ...
Hello Friend!!!! Here is the solution....using EnsureVisible!! Try with this:


Private Sub Form_Load()
With ListView1
.View = lvwReport
.ColumnHeaders.Add , , "TEST"
.ListItems.Add 1, , "5"
.ListItems.Add 1, , "4"
.ListItems.Add 1, , "3"
.ListItems.Add 1, , "2"
.ListItems.Add 1, , "1"
Set .SelectedItem = .ListItems(1)
.SelectedItem.EnsureVisible
End With
End Sub
i have used combobox for item name help, i need code and itemname in variable when i select item form bombo and i want to move cursor according to adding word in search tex.
pls help me send me coding at susamudre@yahoo.com
regards
santosh
Reputation Points: 10
Solved Threads: 0
Newbie Poster
susamudre is offline Offline
2 posts
since Dec 2006
Dec 25th, 2006
0

Re: Listview

Hi,

Use this code

Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
  1. Private Sub cmdShowList_Click()
  2. With ListView1
  3. .HideSelection = False
  4. .FullRowSelect = True
  5. .View = lvwReport
  6. .ColumnHeaders.clear
  7. .ListItems.clear
  8. .ColumnHeaders.Add , , "CHECKING"
  9. .ListItems.Add , , "1"
  10. .ListItems.Add , , "2"
  11. .ListItems.Add , , "3"
  12. .ListItems.Add , , "4"
  13. .ListItems.Add , , "5"
  14. .SelectedItem = .ListItems(.ListItems.Count)
  15. .SelectedItem.EnsureVisible
  16. End With
  17. End Sub

Regards
Veena
Reputation Points: 84
Solved Threads: 140
Posting Shark
QVeen72 is offline Offline
923 posts
since Nov 2006

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Visual Basic 4 / 5 / 6 Forum Timeline: progress bar
Next Thread in Visual Basic 4 / 5 / 6 Forum Timeline: VB6 Building Access from code





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC