|
-
Dec 15th, 2003, 11:32 AM
#1
Thread Starter
Addicted Member
Removing listview highlighted row [RESOLVED]
How do you reset the listview so that the last item clicked on is no longer highlighted?
Last edited by GSIV; Dec 15th, 2003 at 04:33 PM.
-
Dec 15th, 2003, 11:39 AM
#2
Sleep mode
-
Dec 15th, 2003, 12:26 PM
#3
Thread Starter
Addicted Member
-
Dec 15th, 2003, 12:39 PM
#4
Thread Starter
Addicted Member
oops... it doesn't work. Here's my code... after showing the messagebox, I want the highlighted item previously clicked to no longer be highlighted.
Code:
Private Sub lvwCensus_DoubleClick(ByVal sender As Object, ByVal e As System.EventArgs) Handles lvwCensus.DoubleClick
Dim intIndex As Integer = lvwCensus.SelectedIndices.Item(0)
MessageBox.Show(intIndex)
Me.lvwCensus.Update()
End Sub
-
Dec 15th, 2003, 03:12 PM
#5
Sleep mode
Ok , the only way I can think of right now is to send focus to another control . Something like this :
VB Code:
Private Sub lvwCensus_DoubleClick(ByVal sender As Object, ByVal e As System.EventArgs) Handles lvwCensus.DoubleClick
Dim intIndex As Integer = lvwCensus.SelectedIndices.Item(0)
MessageBox.Show(intIndex)
Me.Button1.Focus()
End Sub
-
Dec 15th, 2003, 03:27 PM
#6
Thread Starter
Addicted Member
I thought there might have been a better way, but that works fine. Thanks for the help.
-
Dec 15th, 2003, 03:51 PM
#7
I wonder how many charact
found this... haven't test it
VB Code:
If lvw.SelectedItems.Count <> 0 Then lvw.Items.RemoveAt(lvw.SelectedItems(0).Index())
http://www.pscode.com/URLSEO/vb/scripts/ShowCode!asp/txtCodeId!1578/lngWid!10/anyname.htm
otherwise (haven't used listview), is there a selectedindex=-1 work?
-
Dec 15th, 2003, 04:02 PM
#8
Sleep mode
Originally posted by nemaroller
found this... haven't test it
VB Code:
If lvw.SelectedItems.Count <> 0 Then lvw.Items.RemoveAt(lvw.SelectedItems(0).Index())
http://www.pscode.com/URLSEO/vb/scripts/ShowCode!asp/txtCodeId!1578/lngWid!10/anyname.htm
otherwise (haven't used listview), is there a selectedindex=-1 work?
lol , that will remove the listviewitem completely .
-
Dec 15th, 2003, 04:14 PM
#9
I wonder how many charact
Good... then it won't be selected anymore. Case solved
-
Dec 15th, 2003, 04:26 PM
#10
I wonder how many charact
-
Dec 15th, 2003, 04:33 PM
#11
Thread Starter
Addicted Member
Good... then it won't be selected anymore.
Haha! I never knew that learning could be so fun...ny!
Thanks for the link
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|