如何使vb.net 中关闭按钮显示但无效

来源:百度知道 编辑:UC知道 时间:2024/05/08 09:51:54
如题!
GetSystemMenu(Me.hwnd, 0)
另:上面的Me.hwnd在.net中报错。(已经声明了GetSystemMenu)
大家注意是要在.net里使用的,我祈祷有个人给我个可以用的,如果能解释下酒更好了!

Private Declare Function GetSystemMenu() Lib "user32" (ByVal hWnd As Long, _
ByVal bRevert As Long) As Long
Private Declare Function RemoveMenu() Lib "user32" (ByVal hMenu As Long, _
ByVal nPosition As Long, ByVal wFlags As Long) As Long
Private Const MF_REMOVE = &H1000&
Private Const SC_COLSE = &HF060
Private Const SC_MAXIMIZE = &HF030
Private Const SC_MINIMIZE = &HF020
Private Sub Form_Load()Sub Form_Load()
RemoveMenu GetSystemMenu(Me.hWnd, 0), SC_COLSE, MF_REMOVE
RemoveMenu GetSystemMenu(Me.hWnd, 0), SC_MAXIMIZE, MF_REMOVE
RemoveMenu GetSystemMenu(Me.hWnd, 0), SC_MINIMIZE, MF_REMOVE

学习下