Attached is a helper class that you can use to affect the Move and Close item on a form's system menu. If you remove the Move item the user cannot move the form by dragging it. If you grey-out, disable or remove the Close item the Close button on the title bar will be disabled and so will the Alt+F4 key combination. To use it you need just one line of code. Just create an instance in your form like this:and everything else is done for you. Note that if you disable the Close item then you must provide an alternative method of closing the form. Note also that this class addresses the issue that anna7 picked up earlier. It implements the solution that JuggaloBrotha suggested internally.VB Code:
Private menuManager As New SystemMenuManager(Me, False, SystemMenuManager.MenuItemState.Greyed)
Edit:
Attachment removed. See post #1.




Reply With Quote