首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > VB >

怎么禁用窗体右上角的关闭按钮

2012-02-20 
如何禁用窗体右上角的关闭按钮如何禁用窗体右上角的关闭按钮[解决办法]Private Declare Function GetSyste

如何禁用窗体右上角的关闭按钮
如何禁用窗体右上角的关闭按钮

[解决办法]
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_BYPOSITION = &H400&

Private Sub Form_Load()

Dim lHndSysMenu As Long

lHndSysMenu = GetSystemMenu(Me.hwnd, 0)

'Remove Close button
Call RemoveMenu(lHndSysMenu, 6, MF_BYPOSITION)

'Remove Seperator bar
Call RemoveMenu(lHndSysMenu, 5, MF_BYPOSITION)

End Sub

热点排行
Bad Request.