tdhollan Posted February 24, 2004 Posted February 24, 2004 Can someone please help with the following Vb.net code. When I select a file in the open file dialog box, and then click open, why does another openfiledialog box open in which I have to click open a second time? I need the following code to perform an action on �Open� and on �Cancel� in the dialog box, hence the if statement. Any suggestions please? **on button click** Openfiledialog1.Showdialog () If OpenFileDialog1.ShowDialog () = DialogResult.OK then End if Quote
Administrators PlausiblyDamp Posted February 24, 2004 Administrators Posted February 24, 2004 You are calling the showdialog function twice - it will show the dialog twice. Use If OpenFileDialog1.ShowDialog () = DialogResult.OK then End if Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
tdhollan Posted February 24, 2004 Author Posted February 24, 2004 Thanks for the reply. Works perfectly!! However, very confusing since it doesn't seem the showdialog is called in the if statement. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.