I am populating some pictureboxes from a combo box selection, that works until there is a jpg in the folder that doesn't exist. For some reason I can't get the default jpg to come up, can someone help me please?
Thanks in advance for the assistance.....
Thanks in advance for the assistance.....
VB.NET:
Private Sub cmbTime_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmbTime.SelectedIndexChanged
Dim folder As String = "C:\Projects\Dar\Queue Review Files\" & DateTime.ParseExact(cmbDate.SelectedItem.ToString, "MMMM d, yyyy", Nothing).ToString("M-d") & "\Cam {0}\Cam{0}" & cmbTime.Text.Substring(cmbTime.Text.IndexOf("-"))
For i As Integer = 1 To 8
Dim pcb As PictureBox = ApplicationControls.FindControl(Me, "pcbCam" & i)
If Not pcb Is Nothing Then
If File.Exists(String.Format(folder, 1)) Then
pcb.Image = Image.FromFile(String.Format(folder, i))
Else
MsgBox("I am right here")
pcb.Image = Image.FromFile("C:\Projects\Dar\Queue Review Files\noimage.jpg")
End If
End If
Next i
End Sub