Click here to Skip to main content
15,894,405 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
Can anyone tell me how to disable Close(x) button in an excel application which is opened inside a wpf window.

Thanks & Regards,
Ramana
Posted

1 solution

I am not sure whether its possible to "disable" the close window in WPF. But you can hide the title bar which shows the minimize, maximize and close button by setting WindowStyle to None.

Do this in your XAML:

XML
<Window x:Class="Window1"
        WindowStyle="None"


Or you can create a custom title bar and create your own buttons for minimize, maximize and similarly for the close button(which you can disable it).
Good luck.
 
Share this answer
 
Comments
Ramana Bellary 2-May-11 8:43am    
No, I want to disable the close button of an excel file .
Tarun.K.S 3-May-11 3:04am    
I didn't get it. You have an excel file inside a WPF window?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900