C# version here.
SystemMenuManager class - A helper class that you can add an instance of to a form and remove the Move item from the system menu, which renders the form immoveable by the user, and/or disable or remove the Close item, which also disables the Close button on the title bar. When the Close item is disabled or removed the Alt+F4 key combination is also disabled. To use this class just add a single line of code similar to this to your form:Note that it does not affect any other items on the system menu as these should be accessed through properties of the form itself. Also, the Move item can only be removed as disabling it or greying it out seem to have no effect.VB.NET Code:
Private myMenuManager As New SystemMenuManager(Me, False, SystemMenuManager.MenuItemState.Greyed)
EDIT: I've taken the code from post #39 and incorporated it into a class that I've attached to this post. You can use this class to make your form immovable like so:EDIT (8-Jan-2009): I've updated the code for the FormImmobiliser class so it's now a bit simpler and it also addresses a few issues that the old code had.vb.net Code:
Private immobiliser As New FormImmobiliser(Me)




Reply With Quote