0
好吧,我無法循環瀏覽項目列表框並根據文件系統監視程序刪除它們。從列表框中刪除項目
用戶在文本框中輸入一個數值,然後將它們添加到列表框中。
Listbox1.Items.Add(Textbox1.Text)
在這裏,我是如何循環瀏覽列表框項目和觸發msgbox用於測試目的。
Public Sub CheckCreatedPDFs()
For i As Integer = 0 To ListBox1.Items.Count - 1
Dim Watcher As New FileSystemWatcher()
Watcher.Path = "C:\Temp\"
Watcher.NotifyFilter = (NotifyFilters.Attributes)
Watcher.Filter = ListBox1.Items(i) + ".pdf"
AddHandler Watcher.Changed, AddressOf OnChanged
Watcher.EnableRaisingEvents = True
Next i
End Sub
Private Sub OnChanged(source As Object, e As FileSystemEventArgs)
' Specify what is done when a file is created.
MsgBox("SPACE RESERVED FOR REMOVING LISTBOX ITEMS")
End Sub
有關如何刪除這些項目的任何建議?謝謝!