you could use something like this:
vb Code:
Public Class Form1 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click 'browse for folder Dim fbd As New FolderBrowserDialog If fbd.ShowDialog = Windows.Forms.DialogResult.OK Then TextBox1.Text = fbd.SelectedPath End If End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click If IO.Directory.Exists(TextBox1.Text) Then 'button1 has already been clicked 'your code here Else MessageBox.Show("Please select a folder first", My.Application.Info.Title, MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1, MessageBoxOptions.DefaultDesktopOnly, False) End If End Sub End Class




Reply With Quote
