joshuaand Posted November 4, 2003 Posted November 4, 2003 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 Quote
Administrators PlausiblyDamp Posted November 4, 2003 Administrators Posted November 4, 2003 You may have more sucess using the native .Net ListView control rather than goig through interop to the VB6 COM control. Is this a result of usig the migration wizard? Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.