Trap Cancel Button Without Using MessageBox Class
I have a file that opens automatically with an excelApp.Workbooks.Open statement, i.e., I'm not using MessageBox.Show. If the file is in use, I get the message, "'filenam' is being modified. Open as read-only", with OK and Cancel as options. I need to trap the "Cancel" option so I can take various actions if the user chooses this. But since I didn't use the MessageBox, class, how do I do this?
Tim BostwickPosted Jul 4, 2008, 11:16 AM
Sunny ChenPosted Jul 3, 2008, 8:42 PM
I don't know if I understand your question correctly.
In your customized "MessageBox" dialog, put the "Cancel" button and set its "DialogResult" property to "Cancel". And in your caller form, coding as following (Suppose your "MessageBox" is MyDialog):
Hope this helps.
Guest UserPosted Jul 1, 2008, 2:43 PM
HTH