代码:
Private Sub RefreshToDoList() Handles MyBase.Load
If FileExists(NewEvent.ToDoItems_Path) And FileExists(NewEvent.ToDoDates_Path) And FileExists(NewEvent.ToDoContents_Path) Then
If Not ContentOf(NewEvent.ToDoItems_Path).ToString = "" And Not ContentOf(NewEvent.ToDoDates_Path).ToString = "" And Not ContentOf(NewEvent.ToDoContents_Path).ToString = "" Then
ToDoListItems = ContentOf(NewEvent.ToDoItems_Path).ToString.Split(New String() {Environment.NewLine}, StringSplitOptions.None)
ToDoListDates = ContentOf(NewEvent.ToDoDates_Path).ToString.Split(New String() {Environment.NewLine}, StringSplitOptions.None)
ToDoListContents = ContentOf(NewEvent.ToDoContents_Path).ToString.Split(New String() {Environment.NewLine}, StringSplitOptions.None)
End If
If ToDoListItems.Length = ToDoListDates.Length And ToDoListItems.Length = ToDoListContents.Length Then
For count As Integer = 0 To ToDoListItems.Length - 1
ToDoListBox.Items.Add(ToDoListItems(count))
ToDoListInfo(count) = "Date : " + ToDoListDates(count) + Convert.ToString(Environment.NewLine + Environment.NewLine) + "Content : " + ToDoListContents(count)
Next
End If
End If
End Sub
已选中,ToDoListItems.Length
为3
,但ToDoListBox
中只有一个项目。
此代码中的问题是什么?它似乎在for循环中。