Para retirar o botão de fechar da barra de títulos insira o código a seguir abaixo do Public Class Form1
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
Private Const
SC_CLOSE = &HF060&
Private Const
MF_BYCOMMAND = &H0&
Insira também a função abaixo:
Function
RemoveXButton(ByVal
iHWND As Integer)
As Integer
Dim
iSysMenu As Integer
iSysMenu = GetSystemMenu(iHWND,
False)
Return
RemoveMenu(iSysMenu, SC_CLOSE, MF_BYCOMMAND)
End Function
E em Form1_load coloque o seguinte comando:
RemoveXButton(Me.Handle())
Para retirar o botão de Maximinizar e Minimizar vá em Propriedades do Form1 e coloque
False em MaximizeBox e MinimizeBox.
Simples, não?
Nossa... muito Legal !!
ResponderExcluir