最初の5文字を取得して、同じ名前で以前に保存したピクチャーボックスと一致させる必要があります。
例として、このファイル名は12345_Text_Text_Text.pdfである可能性があります
Dim key As String = Path.GetFileNameWithoutExtension(e.Name)
Dim p As PictureBox = CType(Me.Controls(key), PictureBox)
p.Image = My.Resources.Ok
私はこれを行うことでうまくいくと思いました。
Dim subkey As String
Dim key As String = Path.GetFileNameWithoutExtension(e.Name)
subkey = Left(key, 5)
問題はLeft
コマンドのようです、Public Property Left As Integer' has no parameters and its return type cannot be indexed.
ここに完全なサブルーチン;
Private Sub Watcher_Changed(ByVal sender As Object, ByVal e As FileSystemEventArgs) Handles Watcher.Changed
Dim key As String = Path.GetFileNameWithoutExtension(e.Name)
Dim subkey As String
subkey = Left(key, 5)
Dim p As PictureBox = CType(Me.Controls(key), PictureBox)
p.Image = My.Resources.Ok
End Sub
私が間違っていることについての提案?