1

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?

JKennedy
  • 18,150
  • 17
  • 114
  • 198

1 Answers1

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