tags:

views:

25

answers:

1

I am working in a project intended for I need to provide Job number in front of the file name. To do that I need to track the Click event on Save/Open button on the Common dialog. If I could then I could provide Job Number in front of the filename and then could send message to save the file.

How Could I detect if we click on the Save/Open button of our windows click event?

Note: I have implemented the IShellBrowser

+1  A: 

Try this:

if (SaveFileDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK) {
    FileInfo f = new FileInfo(SaveFileDialog.FileName);
    SaveFile(f.DirectoryName + "\\" + jobNumber + f.Name);
}
Homeliss
This is you showed here for a dialog box that we use in the form Application...But i want to hook the OS common dialog and also detect the SAVE/OPEN button click
Md. Rashim Uddin
Ok, now I understand. Unfortunately I don't know how, but after a quick search I did find this: http://www.codeproject.com/KB/dialog/FileDialogs.aspx?msg=3379258Looking in the comments it seems it has a `OnFileOK` function where you can get the selected file names. Hope that helps!
Homeliss
Thank you...for your support
Md. Rashim Uddin