OpenfileDialog - Window is not popping out
05:55 10 Oct 2010

I am working on form . I want small window to pop up when I click button and to will select XML file of my choice from various folder.

I guess, this OpenFileDialog will help me.

private void button3_Click(object sender, EventArgs e)
{
   /
    OpenFileDialog OpenFileDialog1 = new OpenFileDialog();

    openFileDialog1.Filter = " XML Files|*.xml";

    openFileDialog1.InitialDirectory = @"D:\";



    if (OpenFileDialog1.ShowDialog() == DialogResult.OK)
    {
        MessageBox.Show(filed.FileName.ToString());
    }
}

I tried using following code but when I click on the button there window doesn't pop up. I am not geting what mistake I have made.

What is the problem with that?

Thanks!

c# .net winforms openfiledialog