1

これは、モジュールの関数内の私のコードです。を呼び出したプログラムを閉じたいのですがApplication.Exit、実行され続けます。それには正当な理由がありますか?

  Dim OpenFileDialog1 As New FolderBrowserDialog
    If OpenFileDialog1.ShowDialog() = System.Windows.Forms.DialogResult.OK Then

        pictureFolder = OpenFileDialog1.SelectedPath

        movingPictures(pictureFolder)

        'GetImagePath()

    Else

        Dim answer As DialogResult
        answer = MessageBox.Show("The Program needs this folder to continue, " & vbCrLf & _
                                  "Choose Retry to try again, or Cancel to close.", "Retry or Close?", MessageBoxButtons.RetryCancel, MessageBoxIcon.Information)
        If answer = vbRetry Then
            GoTo RepickOpenfileDialog
        Else
            ' essentially ... here is where I'd like to close the program ... 
            ' but it simply won't... it keeps running though the code... 
            ' there a good reason for that ?
            Application.Exit()
            Form1.Close()
        End If
    End If
    processLock = 0
4

2 に答える 2