Click here to Skip to main content
14,971,527 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All,

I've a windows form (C#). I want to remove maximize button from the window. If i do like
MaximizeBox = false;

maximize button is disbale only. But i want to remove it. How to do this?
Updated 13-Feb-12 17:53pm
manognya kota 13-Feb-12 23:54pm
Unchecked 'Treat my content as plain html checkbox'

1 solution

You can't remove just the Maximize button. You have to set both Minimize and Maximize to False and both buttons will disappear. You can't do just one of them and have that button disappear.
Toli Cuturicu 11-Sep-12 13:29pm
Are you absolutely sure it cannot be done even using pInvoke?
Dave Kreskowiak 11-Sep-12 15:42pm
Nope. You cannot remove just the button, not even by PInvoking the window style.

You CAN however remove the control box entirely and draw in and wire up your own custom buttons. I'll leave that up to you to figure out as it's way too much information to post here and it's not for the beginner.
John Whitmire 18-Dec-20 15:33pm
I have incurred the same need. I want the user to be able to minimize the window, but not maximize it. The window size is very small, and the full Control Box crowds the title bar such that the window title only shows a couple characters. (I thought I remembered from Win7 that the disabled button wouldn't show, but that isn't the case in Win10. The Control Box itself was a lot smaller in Win7, too.)
Do you have a little bit of starter code I can use to create my own, smaller control box?
Dave Kreskowiak 19-Dec-20 11:44am
Nope. I have no need for such.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900