SaveFileDialog and OverwritePrompt
-
Can you share the code how you invoke the SaveFileDialog, in my application its in front of the Winform UI. It's the same SaveFileDialog with an additional button "Help" pressing the Help button should display a page on how to use this dialog. however when i tested in my PC pressing the Help buttons pops nothing.
Jibesh V P
-
jibesh wrote:
Can you share the code how you invoke the SaveFileDialog
if (saveProjectDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK) { SaveProject(saveProjectDialog.FileName); etc. But I just found out it isn't just the SaveFileDialog doing it. Every MessageBox is doing the same. (No, nothing in the project is set to TopMost.) I don't have anywhere to post screen captures at the moment, but the dialogs are different when ShowHelp is used or not. One is a huge Windows 7 Explorer-ish box, the other is a small dialog with the 5 icons down the left side for Recent Places, Desktop, Libraries, Computer, Network.
-
Quote:
Every MessageBox is doing the same
so this is nothing to do with the SaveFileDialog. Is just the MessageBox in your application behaves like this or same for the whole PC?
Jibesh V P
-
Just my app. (And on this and my home machine)
-
can you provide some more information about your Form where you display the saveFileDialog. how the form is displayed? was it a MDI Child? or a simple winform.
Jibesh V P
-
It's just the main form of a winforms app. The only settings on it that aren't the default are: DoubleBuffered : True StartPosition: CenterScreen
that's strange :doh: . hmmm.. lets try all other possibilities then. 1. Clean and Rebuild all your solution 2. create a new sample winformn with one button on it and to call the same method, if it works there something is modified in your code. handled any other events?
Jibesh V P
-
that's strange :doh: . hmmm.. lets try all other possibilities then. 1. Clean and Rebuild all your solution 2. create a new sample winformn with one button on it and to call the same method, if it works there something is modified in your code. handled any other events?
Jibesh V P
1. Done multiple times 2. other events: Closing (prompts to save files) Load (sets an MRU menu and lcoses the Splash form. Thought it might be the Splash, but taking that out didn't fix it. At this stage, I think I'll just go with a home-built prompt form instead of the MessageBox. At least that I can set to topmost...and it works. (It's also nice to have it look like the rest of the program instead of generic Windows box popping up.)
-
WinForms, of course. Any idea why the overwrite prompt is popping up behind everything, rather than in front of everything where it might be useful? Pushing the Alt key brings it immediately up where it belongs. (As an aside, why are there two different SaveFileDialogs, depending on whether you choose to "ShowHelp"?)
This will happen if you're creating the message box in a different thread. Make sure that any event handlers on asynchronous processes (network communication, serial ports, BackgroundWorker, TPL or ThreadPool background tasks, etc) that refer to the UI get BeginInvoke'd. You mentioned a splash screen ... that is often done on a separate thread to the main UI, so check you haven't ended up creating message boxes in that thread.
-
This will happen if you're creating the message box in a different thread. Make sure that any event handlers on asynchronous processes (network communication, serial ports, BackgroundWorker, TPL or ThreadPool background tasks, etc) that refer to the UI get BeginInvoke'd. You mentioned a splash screen ... that is often done on a separate thread to the main UI, so check you haven't ended up creating message boxes in that thread.
No threading in the app. Not even the Splash. No "weird" things involved except creating some bits and pieces on the fly. I even tried setting the owner on the dialog, hoping it would pass it along and fix the problem, but to no avail. Another odd thing the app does: when starting, it will appear on the screen wherever the mouse cursor happens to be, i.e. start it on monitor 1, then move the mouse over to monitor 2 to do something else and it will show up over there on monitor 2. (Extended display, dual monitors) Programming is SO much fun. :p
-
WinForms, of course. Any idea why the overwrite prompt is popping up behind everything, rather than in front of everything where it might be useful? Pushing the Alt key brings it immediately up where it belongs. (As an aside, why are there two different SaveFileDialogs, depending on whether you choose to "ShowHelp"?)
It might not be your code, It might be this: Windows 7, new windows opening behind other windows[^]
-
It might not be your code, It might be this: Windows 7, new windows opening behind other windows[^]