M
Mike Johnson
The sub is being called from the Sub New(). If I can't use
Application.Exit() in this situation then how do I exit the application?
please help.
Public Sub Check_For_Dir()
Dim MyPath, MyName As String
MyPath = FilePath ' Set the path.
MyName = Dir(MyPath, FileAttribute.Directory) ' Retrieve the first
entry.
For i As Integer = 0 To 9999
If MessageBox.Show("Path " + FilePath + " not available, press
Yes to try again or No to Exit.", "Error", _
MessageBoxButtons.YesNo) = DialogResult.Yes Then
'Run Sub again
Check_For_Dir()
Else
Me.Close()
Exit Sub
End If
Next
End Sub
Application.Exit() in this situation then how do I exit the application?
please help.
Public Sub Check_For_Dir()
Dim MyPath, MyName As String
MyPath = FilePath ' Set the path.
MyName = Dir(MyPath, FileAttribute.Directory) ' Retrieve the first
entry.
For i As Integer = 0 To 9999
If MessageBox.Show("Path " + FilePath + " not available, press
Yes to try again or No to Exit.", "Error", _
MessageBoxButtons.YesNo) = DialogResult.Yes Then
'Run Sub again
Check_For_Dir()
Else
Me.Close()
Exit Sub
End If
Next
End Sub