OpenFileDialog control in VB.NET 2010
This article shows openfiledialog control in VB.NET 2010.
In this article we will learn about the file open dialog
control in window application in VB.NET.
This control are used to select a file. These are the
some common properties of OpenFileDialog control:
Property used to get or set file name selected in the
file dialog box.
Property to used to get or set the current file name
filter string which sets the choices that appear in 'Save as file type' or
'Files of type' box.
To display the dialog box to the user, call the
click the OpenFileDialog control from toolbox it will take place below the form
and take two control picture box control and button to the form.
Now, double click on the button named openfile in the
form and write the following code.
sender As System.Object,
ByVal e As
System.EventArgs) Handles Button1.Click
OpenFileDialog1.Filter = "All
To dynamically load the images use Image
class with FromFile() method.
Now press Ctrl+F5 to run the application.
The below window will appear and we choose an image and
than and then click on the button named openfile.the image will display on the
Now select an image and click the button open image will
display on the picture box.we select image named two_flower from the open file.