April 18, 2024, 10:14:43 PM

News:

IonicWind Snippit Manager 2.xx Released!  Install it on a memory stick and take it with you!  With or without IWBasic!


Disabling the X in a titlebar

Started by Brian, February 06, 2018, 07:48:40 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Brian

I obviously have nothing better to do. But scrabbling about through my old code, I saw this. It prevents a window being closed by pressing the X button. After a bit of calafudging . . .

When you first run it, you can close the window by pressing X or the Close button

Run it again. When you click the 'Disable X' button you can't close the window - only by pressing the 'Close' button

Enable it again by pressing the 'Enable X' button

(Sorry, Andy!)

Brian


Andy

Brian,

Don't worry about it! - it's a nice bit of code.

Anyway, I could easily do it with my custom window, I would just need to add back in a maximise box. As you've seen, I know when you are clicking the close box in a custom window, so it would be easy to get the same effect.

Andy.
Day after day, day after day, we struck nor breath nor motion, as idle as a painted ship upon a painted ocean.