hi, can anyone help me solve this problem, i want to select all items from listview at once thru loop but it doesnt work. my code below
For i = 0 To ListView1.Items.Count - 1
ListView1.Items(i).Selected = True
Next i
Like in listbox, you will just setSelected=true. so if you have an idea just reply.
thanks
kaymaf
select all items in listview
Page 1 of 15 Replies - 22723 Views - Last Post: 25 November 2007 - 11:52 PM
Replies To: select all items in listview
#2
Re: select all items in listview
Posted 20 November 2007 - 02:10 AM
kaymaf, on 19 Nov, 2007 - 09:37 PM, said:
hi, can anyone help me solve this problem, i want to select all items from listview at once thru loop but it doesnt work. my code below
For i = 0 To ListView1.Items.Count - 1
ListView1.Items(i).Selected = True
Next i
Like in listbox, you will just setSelected=true. so if you have an idea just reply.
thanks
kaymaf
For i = 0 To ListView1.Items.Count - 1
ListView1.Items(i).Selected = True
Next i
Like in listbox, you will just setSelected=true. so if you have an idea just reply.
thanks
kaymaf
Try This...
For i As Integer = 0 To ListView1.Items.Count - 1 Step 1
ListView1.SetSelected(i, True)
Next i
#3
Re: select all items in listview
Posted 20 November 2007 - 07:17 AM
f_soto, on 20 Nov, 2007 - 02:10 AM, said:
kaymaf, on 19 Nov, 2007 - 09:37 PM, said:
hi, can anyone help me solve this problem, i want to select all items from listview at once thru loop but it doesnt work. my code below
For i = 0 To ListView1.Items.Count - 1
ListView1.Items(i).Selected = True
Next i
Like in listbox, you will just setSelected=true. so if you have an idea just reply.
thanks
kaymaf
For i = 0 To ListView1.Items.Count - 1
ListView1.Items(i).Selected = True
Next i
Like in listbox, you will just setSelected=true. so if you have an idea just reply.
thanks
kaymaf
Try This...
For i As Integer = 0 To ListView1.Items.Count - 1 Step 1
ListView1.SetSelected(i, True)
Next i
hi f_soto , thanks for reply. this method is for listbox not list view
ListView1.SetSelected(i, True)
kaymaf
#4
Re: select all items in listview
Posted 20 November 2007 - 07:26 AM
kaymaf, on 20 Nov, 2007 - 07:17 AM, said:
f_soto, on 20 Nov, 2007 - 02:10 AM, said:
kaymaf, on 19 Nov, 2007 - 09:37 PM, said:
hi, can anyone help me solve this problem, i want to select all items from listview at once thru loop but it doesnt work. my code below
For i = 0 To ListView1.Items.Count - 1
ListView1.Items(i).Selected = True
Next i
Like in listbox, you will just setSelected=true. so if you have an idea just reply.
thanks
kaymaf
For i = 0 To ListView1.Items.Count - 1
ListView1.Items(i).Selected = True
Next i
Like in listbox, you will just setSelected=true. so if you have an idea just reply.
thanks
kaymaf
Try This...
For i As Integer = 0 To ListView1.Items.Count - 1 Step 1
ListView1.SetSelected(i, True)
Next i
hi f_soto , thanks for reply. this method is for listbox not list view
ListView1.SetSelected(i, True)
kaymaf
this function below works but it doesnt highlight the file icon or image and the highlight color is gray like SystemColors.control. so if you have any idea how to use sendkey pls help
For i = 0 To ListView1.Items.Count - 1
ListView1.Items(i).Selected = True
Next i
#5
Re: select all items in listview
Posted 21 November 2007 - 06:06 AM
Quote
this function below works but it doesnt highlight the file icon or image and the highlight color is gray like SystemColors.control
Check to make sure the listbox isn't ReadOnly and that you have Allow Multiple Selections set to true.
Quote
so if you have any idea how to use sendkey pls help
What do you need to use sendkey for?
Also, please always post your code between the code tags as such:
[ Code] Code goes here [ /Code] without the spaces of course.
#6
Re: select all items in listview
Posted 25 November 2007 - 11:52 PM
Dim myString As String = "howdy" ListBox1.Items.Add(myString) ListBox1.SelectedItems.Add(ListBox1.Items.Item(0))
Try this, it will highlight the item as it's added to the selecteditems collection
This post has been edited by Pwn: 25 November 2007 - 11:54 PM
Page 1 of 1
|
|

New Topic/Question
Reply




MultiQuote





|