Browse button code(messagebox yes/no)

dwyane123

Member
Joined
Oct 14, 2008
Messages
23
Programming Experience
Beginner
Hi all, I need to create a browse button so that i could browse file from the PDA to select file. Hence i use this code. However, it opens the file directly. How do i combine this code and make it a point that the message box will give me an option to either open or cancel. Thanks alot



VB.NET:
            Using ofd As New OpenFileDialog
                ofd.Filter = "Text Files (*.txt)|*.txt"
                ofd.FileName = "Select File"

                If ofd.ShowDialog() = Windows.Forms.DialogResult.OK Then
                    MessageBox.Show("You selected " & ofd.FileName)
                   
     
                  'do what ever
                End If
            End Using
       

        End If
 
MessageBox.Show is overloaded and provides numerous options. Read the MSDN documentation or make use of Intellisense and it will show you what options are available. This is a nice, easy way to learn how to find information for yourself, which will save you a lot of time.
 
Back
Top