Results 1 to 37 of 37

Thread: [RESOLVED] Read write xml

Hybrid View

  1. #1
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    26,423

    Re: Read write xml

    you could use something like this:

    vb Code:
    1. Public Class Form1
    2.  
    3.     Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    4.         'browse for folder
    5.         Dim fbd As New FolderBrowserDialog
    6.         If fbd.ShowDialog = Windows.Forms.DialogResult.OK Then
    7.             TextBox1.Text = fbd.SelectedPath
    8.         End If
    9.     End Sub
    10.  
    11.     Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
    12.         If IO.Directory.Exists(TextBox1.Text) Then
    13.             'button1 has already been clicked
    14.             'your code here
    15.         Else
    16.             MessageBox.Show("Please select a folder first", My.Application.Info.Title, MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1, MessageBoxOptions.DefaultDesktopOnly, False)
    17.         End If
    18.     End Sub
    19.  
    20. End Class

  2. #2

    Thread Starter
    Member
    Join Date
    May 2012
    Posts
    38

    Re: Read write xml

    Thanks. However when I click in the messagebox, it closes the form. Is there a way to close the messagebox but keep the form open? That way it would not be necessay to reopen the form to select folder.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width