I have the following items in a checklist. I am using 2005:
what I want is if someone clicks "Housing", everything starting with housing is checked, or if the user clicks "Community everything starting with community is checked. And vice versa if it is unchecked.Code:Community Community-->Activities Community-->Artists Community-->Childcare Community-->General Community-->Groups Community-->Pets Community-->Events Community-->Lost+Found Community-->Musicians Community-->Local New Community-->Politics Community-->Rideshare Community-->Volunteers Housing Housing-->Apts/Housing Housing-->Rooms/Shared Housing-->Sublets/Temporary Housing-->Housing Wanted Housing-->Housing Swap Housing-->Vacation Rental Housing-->Parking/Storage Housing-->Office/Commercial Housing-->Real Estate for Sale
I tried this but it results in a stack overflow on SetItemChecked:
any ideas on how i can accomplish this?Code:Private Sub chkCategories_ItemCheck(ByVal sender As Object, ByVal e As System.Windows.Forms.ItemCheckEventArgs) Handles chkCategories.ItemCheck 'loop through the checklist If Me.chkCategories.SelectedItem = "Community" Then For i As Integer = 0 To Me.chkCategories.Items.Count - 1 If Me.chkCategories.Items.Item(i).ToString.StartsWith("Community") = True Then Me.chkCategories.SetItemChecked(i, True) End If Next End If End Sub End Class




Reply With Quote