Sometimes it is desirable to prevent a user from moving a form.A little known feature of Windows is that for any form, functionalitythat doesn’t appear in the control menu (ControlBox in VB terms)is not available to that form. Therefore, remove the Move commandfrom that form’s control menu to prevent a form from being moved:
Declare Function GetMenu% Lib "User" (ByVal hWnd%)Declare Function RemoveMenu% Lib "User" (ByVal hMenu%, _ ByVal nPosition%, ByVal wFlags%)Const SC_MOVE = &hF010, MF_BYPOSITION = &H400' This deletes the Move command from the form's' control menuDim Res%Res = RemoveMenu(GetMenu(Form.hWnd), SC_MOVE, MF_BYCOMMAND)
Charlie has over a decade of experience in website administration and technology management. As the site admin, he oversees all technical aspects of running a high-traffic online platform, ensuring optimal performance, security, and user experience.























