Showing posts with label using dialogbox in c sharp. Show all posts
Showing posts with label using dialogbox in c sharp. Show all posts

Wednesday, September 11, 2013

How to use open dialog box in C#

First of all, we need to place a opendialogbox control on our form.


string filename;
OpenFileDialog openFileDialog1 = new OpenFileDialog();

openFileDialog1.Filter = "*.xls | *.xlsx";
openFileDialog1.ShowDialog();
filename = openFileDialog1.FileName.ToString();