Example Apps for Businesses, Schools & Developers

First Published 30 Dec 2024


This article was prompted by a thread at Access World Forums: Why are the Min, max, and X buttons disabled?

The original poster @donkey9972 provided a simple database with a single form asking "why are the min, max, and X buttons disabled?". In this case, there was no code and he/she wanted to know how this was done.

When the database was opened in a trusted location, it looked like this:

Curious Donkey Form
The form appearance and behaviour was due to two properties:
a)   The form was modal which meant the application buttons, navigation pane, ribbon and menu bar were all disabled / inactive whilst the form was open
b)   The form was borderless so it couldn't easily be closed

Normally, these two properties would not be used together unless another method was provided to close the form e.g. a Close button.
It wasn't clear whether this had been created by someone who didn't understand the implications . . . or a a deliberate challenge to others.

There was a simple solution. Right clicking the form, opened a shortcut menu allowing the form to be closed.

ShortcutMenu
Once the form was closed, all other application features including the title bar buttons were enabled and the app could easily be closed.


However, this got me thinking! The idea could be further extended by disabling the shortcut menu in the form property sheet.
This would prevent users right clicking to close the form. However they can still use the standard Windows shortcut, Alt+F4, to do so.

The next step could be to disable standard shortcut keys such as Alt+F4. I have done this in the attached application using the Form_KeyDown event and remapping certain key combinations to nothing

I decided to take this further by hiding the following application features: ribbon, navigation pane and status bar.
To prevent users clicking the taskbar icon, I also hid the Windows taskbar as well.

Locked Down App
Users can still use Ctrl+Alt+Del to open Task Manager and then quit the application.
However, forcibly closing apps is not recommended. In addition, by doing this the Windows taskbar would not be restored.

NOTE:
It is possible to disable the the use of the Ctrl+Alt+Del key combination by editing the registry.
However, doing this would be a fairly extreme action as it would apply not just for the current app but for all applications.

If you really want to know how this can be done, see my example app: A Kiosk Style Application   TAKE CARE! Study the instructions in that article carefully first!

In the attached example, I have provided three shortcut keys to safely manage the application. See the Autokeys macro for details.

1.   Ctrl + Shift + F - closes the form, makes the taskbar, navigation pane and ribbon visible and also re-enables the title bar buttons.
2.   Ctrl + S - opens the form and hides the taskbar
3.   Ctrl + Q - closes the application and makes the taskbar visible

To view the code, you can also open the app with the shift bypass.


OK, so this is a curiosity but does a borderless, modal form have any practical use other than as a challenge to other users?

Yes, provided the form has an Quit Application button.
It could be used to ensure that specified code runs before the application closes by ensuring there is no other way of closing the app.

It would normally be the first form that opens when the app is loaded and the last form to be closed before quitting.


Download

Click to download       A Curious DB      0.5 MB (ACCDB - zipped)


Feedback

Please use the contact form below to let me know whether you found this article interesting/useful or if you have any questions/comments.

Please also consider making a donation towards the costs of maintaining this website. Thank you



Colin Riddington           Mendip Data Systems                 Last Updated 30 Dec 2024



Return to Example Databases Page




Return to Top