is there a way to disable the three windows buttons in the top right corner of the window? and disable move and resize?
Printable View
is there a way to disable the three windows buttons in the top right corner of the window? and disable move and resize?
Q1 : Set the ControlBox property to False (takes it away, doesn't disable)
Q2.5 : Set the BorderStyle property to Fixed Single
:)
Set the properties of the form :
control box - false
movable - false
border - single fixed
You can also use the RemoveMenu API function to disable all these if you wish to do it in runtime.
VB Code:
Private Declare Function GetSystemMenu Lib "User32" _ (ByVal hWnd As Integer, ByVal bRevert As Integer) As Integer Private Declare Function RemoveMenu Lib "User32" (ByVal hMenu _ As Integer, ByVal nPosition As Integer, ByVal wFlags As Integer) _ As Integer Const MF_BYPOSITION = &H400 Private Sub Form_Load() RemoveMenu GetSystemMenu(hWnd, 0), 0, MF_BYPOSITION RemoveMenu GetSystemMenu(hWnd, 0), 0, MF_BYPOSITION RemoveMenu GetSystemMenu(hWnd, 0), 0, MF_BYPOSITION RemoveMenu GetSystemMenu(hWnd, 0), 0, MF_BYPOSITION RemoveMenu GetSystemMenu(hWnd, 0), 0, MF_BYPOSITION RemoveMenu GetSystemMenu(hWnd, 0), 0, MF_BYPOSITION RemoveMenu GetSystemMenu(hWnd, 0), 0, MF_BYPOSITION End Sub