C
cj
I run this program and to exit click the X in the upper right corner.
But apparently it isn't really ending the program. If I return to VB
and make changes then try to rebuild the app it says the exe is still in
use--I find it is still a process in Task Manager. What do I need to do
to make clicking that X actually end the program?
Public Class Form1
Inherits System.Windows.Forms.Form
#Region " Windows Form Designer generated code "
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Me.Show()
Application.DoEvents()
Dim result As DialogResult
result = FolderBrowserDialog1.ShowDialog()
If result = DialogResult.Cancel Then
End
End If
' Create a reference to the current directory.
Dim DirInfo As New
System.IO.DirectoryInfo(FolderBrowserDialog1.SelectedPath)
' Create an array representing the files in the current directory.
Dim FileInfo As System.IO.FileInfo() = DirInfo.GetFiles("*.jpg")
For Each File As System.io.FileInfo In FileInfo
Label1.Text = File.FullName
PictureBox1.Image = Image.FromFile(File.FullName)
Application.DoEvents()
System.Threading.Thread.Sleep(2000)
Next
End
End Sub
End Class
But apparently it isn't really ending the program. If I return to VB
and make changes then try to rebuild the app it says the exe is still in
use--I find it is still a process in Task Manager. What do I need to do
to make clicking that X actually end the program?
Public Class Form1
Inherits System.Windows.Forms.Form
#Region " Windows Form Designer generated code "
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Me.Show()
Application.DoEvents()
Dim result As DialogResult
result = FolderBrowserDialog1.ShowDialog()
If result = DialogResult.Cancel Then
End
End If
' Create a reference to the current directory.
Dim DirInfo As New
System.IO.DirectoryInfo(FolderBrowserDialog1.SelectedPath)
' Create an array representing the files in the current directory.
Dim FileInfo As System.IO.FileInfo() = DirInfo.GetFiles("*.jpg")
For Each File As System.io.FileInfo In FileInfo
Label1.Text = File.FullName
PictureBox1.Image = Image.FromFile(File.FullName)
Application.DoEvents()
System.Threading.Thread.Sleep(2000)
Next
End
End Sub
End Class