×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Remove Min/max/close buttons

Remove Min/max/close buttons

Remove Min/max/close buttons

(OP)
1) What is the official name of the min/max/close button trio?

2) How can i remove the trio from a window that has already been created?

Ashthud

RE: Remove Min/max/close buttons

I looked at the second thread closer and am reminded you can remove the entire menu.  Look there for what you want.

----------
Measurement is not management.

RE: Remove Min/max/close buttons

You can do this by toggling the WS_SYSMENU bit in window styles. See the following VB code. This is like setting the ControlBox property in design time in VB.
___

Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long
Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Const GWL_STYLE = -16
Const WS_SYSMENU = &H80000
Const WM_NCPAINT = &H85
Private Sub Command1_Click()
SetWindowLong hwnd, GWL_STYLE, GetWindowLong(hwnd, GWL_STYLE) Xor WS_SYSMENU
SendMessage hwnd, WM_NCPAINT, 0, ByVal 0& 'repaint the title bar
End Sub

RE: Remove Min/max/close buttons

In the property window for the form, under Window Style you will see Control Box select it and change it to false.

This will get rid of the min/max/close btns, and if you get rid of the .text for the form the border will shrink and be uniform around the form.

RE: Remove Min/max/close buttons

>the property window for the form

Which unfortunately we won't have for a window that has already been created as per the original question. Hence Glenn9999's and Hypetia's solutions

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login


Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close