|
-
Jun 1st, 2003, 06:57 AM
#1
Thread Starter
Hyperactive Member
Listview Select Problem - Run code
I have 4 items in my listview, the listview in in large icon mode.
I want it so that when a user clicks on item 1, a peice of code activates, and do that for each of the 4 items, each peice of code is different. I was thinking about doing it in a select case, but I don't know how to, I am using VB.net. Thank you for you time,
- Gabe
-
Jun 1st, 2003, 01:00 PM
#2
Sleep mode
Try this code ,
VB Code:
Private Sub ListView1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ListView1.SelectedIndexChanged
Dim i As Integer = 0
For i = 0 To ListView1.Items.Count - 1
If ListView1.Items(i).Selected = True Then
Select Case ListView1.Items(i).Index
Case 0
MsgBox("Case 0 fired")
'Do your this
Case 1
MsgBox("Case 1 fired")
'Do your this
Case 2
MsgBox("Case 2 fired")
'Do your this
Case 3
MsgBox("Case 3 fired")
'Do your this
End Select
End If
Next
End Sub
-
Jun 1st, 2003, 01:23 PM
#3
Thread Starter
Hyperactive Member
Thank you.
Thank you, works perfectly.
-
Jun 1st, 2003, 01:25 PM
#4
Sleep mode
Re: Thank you.
Originally posted by gmatteson
Thank you, works perfectly.
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
|