Help With Listview CheckAll

listview , itemcheck , checkstate Denton, United States
  • 12 years ago
    Hi Everybody.. Hope you can help me solve this.. I want to check all the listviewitems by checking the first Index This is my Code.. Private Sub lv_ItemCheck(ByVal sender As Object, ByVal e As System.Windows.Forms.ItemCheckEventArgs) Handles lv.ItemCheck If e.Index = 0 And e.NewValue = CheckState.Checked Then For Each listItem As ListViewItem In lv.Items listItem.Checked = True Next End If End Sub I run this Event and i got this error/exception 'StackOverflowException was unhandled' Any Solution,suggestions, or better code? Thanks...
  • 12 years ago
    hi kabs! stackoverflowexception could mean that theres an infinite loop in your code. it could be in your foreach statement. try to debug and review your code.

Post a reply

Enter your message below

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“Beware of bugs in the above code; I have only proved it correct, not tried it.” - Donald Knuth