爱问 爱问共享资料 爱问分类

VB6.0编程中如何去掉关闭按扭或者改变其外观?

首页 >
电脑/网络
程序设计
VB

VB6.0编程中如何去掉关闭按扭或者改变其外观?


	 	
	 

好评回答

    2019-03-08 19:29:59
  •   代码如下:点击窗体退出
    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 Declare Function DrawMenuBar Lib "User32" (ByVal hwnd As Long) As Long
    Private Declare Function GetMenuItemCount Lib "User32" (ByVal hMenu As Long) As Long
    Private Const MF_BYPOSITION = &H400&
    Private Const MF_DISABLED = &H2&
    Private Sub Form_Click()
    End
    End Sub
    Private Sub Form_Load()
    Dim hMenu As Long, nCount As Long
    hMenu = GetSystemMenu(Me。
      hwnd, 0) nCount = GetMenuItemCount(hMenu) RemoveMenu hMenu, nCount - 1, MF_DISABLED Or MF_BYPOSITION DrawMenuBar Me。hwnd End Sub。
      

其他答案

    2019-03-08 20:04:30
  • 设置窗体的属性BorderStyle为0
    或者用代码是窗体的关闭按扭失效:
    Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
    Cancel = -1
    End Sub
    改变其外观可参阅 
    
  • 2019-03-08 19:12:46
  • 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 Sub Form_Load()
      RemoveMenu GetSystemMenu(Me.hwnd, 0), &HF060, 0
    End Sub

类似问题

换一换
  • VB相关知识

相关推荐

正在加载...
爱问推荐

相关资料

热点检索
确定举报此问题
举报原因(必选):
报告,这不是个问题
报告原因(必选):
返回
顶部