So I posted a thread lastnight looking for help on a problem I ran into. Since then I found a better way I could do it an I almost have it where I want it but need a little help. Here a quick rundown.
As the title says this is basically my problem. In my application I have a feature to add breakpoints/bookmarks in the textbox that the user is inputting information into. As they add the breakpoint it adds the line number that the item is on and also the contents of that line to a listview. Line number in first column line content goes in the second column. So now I have added multiple document abilities in the application so I devised a way to have it clear the listview on tab change and re- add all breakpoints that are in the current textbox.
The only problem is that it only works for the first breakpoint added. Then I get an error stating something along the lines that the number three cant be added more than once please remove it or clone it. Im thinking I have something wrong with the multiple loops. Maybe I need to change the location of the loops?
Anyways if someone could look at it and tell me what is wrong I would appreciate it.
vb Code:
Private Sub page_TabIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) For Each lvitem As ListViewItem In ListView1.Items lvitem.Remove() Next Dim breaklist As New ListViewItem Dim page As RadPageViewPage = RadPageView1.SelectedPage For Each txt As FastColoredTextBox In page.Controls.OfType(Of FastColoredTextBox)() For i As Integer = 0 To bookmarks.Count - 1 Dim id As Integer = bookmarks(i) Dim boom As String For f As Integer = 0 To txt.LinesCount - 1 If txt(f).UniqueId = id Then breaklist.Text = CStr((f + 1)) boom = txt.GetLineText(f) breaklist.SubItems.Add(boom) ListView1.Items.Add(breaklist) End If Next Next Next End Sub


Reply With Quote



.