~~~~~~~~~~~~~~~~~~~~~~~~~
Private Sub Button1_Click( _
ByVal sender As System.Object, _
ByVal e As System.EventArgs) _
Handles Button1.Click
Dim i As Integer
For i = 1 To 10
If TryDisk("a:\fileopen.bmp") = True Then Exit For
Next i
If i > 10 Then
MsgBox("File Load feature disabled")
Button1.Enabled = False
End If
End Sub
Private Function TryDisk( _
ByVal PictureLocation As String) _
As Boolean
Try
PictureBox1.Image = _
System.Drawing.Bitmap.FromFile(PictureLocation)
Return True
Catch
MsgBox("Insert the disk in drive A, then click OK!")
Return False
End Try
End Function
~~~~~~~~~~~~~~~~~~~~~~~~~

