3
Reply

Opening files

mithil Malhotra

mithil Malhotra

May 24 2010 4:56 AM
3.6k
Hiiii

Anyone would suggest me when i open a file and cilck ok button it should open in seperate dialog box. Here when i am clicking on open button, the dialog box appears. I selected a particular file, while opening the file its showing the path name in text box i gave to my form.

This i am using to open a file dialog, and selecting the file which is showing it into the textbox.

Private Sub OpenToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OpenToolStripMenuItem.Click
        If OpenFileDialog1.ShowDialog() <> Windows.Forms.DialogResult.Cancel Then
            TextBox1.Text = OpenFileDialog1.FileName
        End If
    End Sub

But when i click on open buttons next to textbox, that file should open which i have selected. Here is the Image of that.

Would anyone suggest me how to write the code for that.

Regard
Mithil



Answers (3)