Hi everyone, I am facing a little problem in my program.
I have a form called 'Bookmarks' that loads a bookmark file that contains a single word
on one line. I have put buttons on the form for sorting this list, deleting items and changing the character case to lowercase, uppercase or Sentence Case.
Now, deleting and sorting the list works fine, but when I try to change character cases,
nothing happens. I started the debugger and found that my case changing code does work, but the listbox doesn't seem to update it's contents.
I tried listbox.Update() and listbox.Refresh() but that didn't work either.
Please help.
Here's my code for 'Set Case':
I have a form called 'Bookmarks' that loads a bookmark file that contains a single word
on one line. I have put buttons on the form for sorting this list, deleting items and changing the character case to lowercase, uppercase or Sentence Case.
Now, deleting and sorting the list works fine, but when I try to change character cases,
nothing happens. I started the debugger and found that my case changing code does work, but the listbox doesn't seem to update it's contents.
I tried listbox.Update() and listbox.Refresh() but that didn't work either.
Please help.
Here's my code for 'Set Case':
VB.NET:
Private Sub setCase_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles setCase.Click
If bookCase = "default" Then Exit Sub
If bookCase = "lower" Then
For i = 0 To marksList.Items.Count - 1
marksList.Items.Item(i) = LCase(marksList.Items.Item(i))
Next
ElseIf bookCase = "upper" Then
For i = 0 To marksList.Items.Count - 1
marksList.Items.Item(i) = UCase(marksList.Items.Item(i))
Next
ElseIf bookCase = "sentence" Then
For i = 0 To marksList.Items.Count - 1
Dim tmp As String = UCase(Mid(marksList.Items.Item(i), 1, 1)) + Mid(LCase(marksList.Items.Item(i)), 2)
marksList.Items.Item(i) = tmp
Next
End If
End Sub