开发者

Throwing error on OpenFileDialog.Showdialog in c#.net

I am developing a windows application in XP machine.in my one form i have one text box for showing the selected file with path from openfiledialog box.and the other control is button to call the openfiledialog box.

When I cliked on the button to call the open dialog box i am getting the follwing开发者_JS百科 error

Throwing error on OpenFileDialog.Showdialog in c#.net

rest of the form contains another controls like data grid and dropdowns.

Please help me to resolve this issue

Thanx in advance.

Regards, Sudarshan

Update

Here is my code on button click

        OpenFileDialog  openfiledialog = new OpenFileDialog();
        openfiledialog.Filter = "xml files|*.xml";
        openfiledialog.Multiselect = false;
        DialogResult dr;
        dr = openfiledialog.ShowDialog();

        if (dr == DialogResult.OK)
        {
            txtgrdDataFile.Text = openfiledialog.FileName.ToString();
        }
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜