I have an application that uploads a picture to my website. While uploading I would like to temporarily disable the user from closing the program. Is there a way to do this? by either temporarily disabling the close button or by intercepting the close call?
Asked
Active
Viewed 861 times
1
-
1Check out [here](http://stackoverflow.com/a/7717394/632337) to intercept the close call. – Rohit Vats Aug 13 '14 at 10:25
-
Just remember a process kill is possible. – Bauss Aug 13 '14 at 10:26
-
@RohitVats Wow that was incredibly simple. Thanks! – JKennedy Aug 13 '14 at 10:31
1 Answers
0
Use the Window.WindowStyle
property. I also suggest to don't display the window in the Taskbar.
<Window x:Class="WpfApplication1.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow" Background="AliceBlue" WindowStyle="None" ShowInTaskbar="False" >
</Window>
Anyway, be aware that is not possible to stop a user to close your program, as long as he can access to the Task Manager.

simoneL
- 602
- 1
- 7
- 23