Results 1 to 2 of 2

Thread: Control Box Questions

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Nov 1999
    Posts
    127

    Question

    I was told that this would be the right forum to post this question so here goes...

    I'm looking for a way to have the minimize and maximize buttons appear on the form, but not the close button.

    Whether or not the minbutton/maxbutton are enabled on the form, the controlbox property overides them, and since there is no closebutton property, I'm kinda stuck.

    Any help appreciated.
    Thanks.

  2. #2
    Guest
    Use this code from Megatron.

    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), 6, MF_BYPOSITION 'Disable Close
    End Sub

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width