Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Hi,

 

Ok I am porting an application to VB.NET from VB6, and have come across a weird problem I cant seem to solve, I think I have been staring at it for too long so any help is appreciated.

 

Here is the scenario:

 

I have a listview, with checkboxes, and I want the user when they click the TEXT, the appropriate checkbox selects, when they click it again, it unselects etc. When you click the checkbox normal operation occurs.

 

This was easy in VB6, this is what I did:

 

Private Sub Contestants_Click()
   If Contestants.SelectedItem.Checked = True Then
       Contestants.SelectedItem.Checked = False
   Else
       Contestants.SelectedItem.Checked = True
   End If
End Sub

Private Sub contestants_ItemCheck(ByVal Item As MSComctlLib.ListItem)
   Contestants.SelectedItem = Item
   If Contestants.SelectedItem.Checked = True Then
       Contestants.SelectedItem.Checked = False
   Else
       Contestants.SelectedItem.Checked = True
   End If
End Sub

 

Ok now my problem is that I cant do this under .NET, it gets all messed up.

 

When I apply similar coding in VB.NET is doesnt work, anyone got any suggestions??

 

Thankyou

Joshua

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...