Reputation: 62145
I often use FormBorderStyle = SizableToolWindow with forms on smaller resolution displays (ie netbooks) for the smaller title-bar height and border sizes.
The MaximimizeBox and MinimizeBox properties are also set to True however it appears they are ignored because only the Close button is displayed.
I have also tried the customizing the window style using the following:
protected override CreateParams CreateParams
{
get
{
CreateParams cp = base.CreateParams;
cp.Style |= 0x00020000; // Turn on Minimize button
cp.Style |= 0x00010000; // Turn on Maximize button
return cp;
}
}
But the Maximize and Minimize buttons are still not shown.
Sizable tool windows are actually shown in the taskbar by default, and can be minimized/maximized by right clicking on the taskbar icon, but this is far less convenient then just showing the buttons on the title-bar as usual.
Any suggestions?
Upvotes: 0
Views: 4186
Reputation: 331
For those seeing a windows forms solutions in the latest version of visual studio where they don't want to resize the form and allow minimum, set FormBorderStyle
to FixedDialog
to fix the size, and then set MaximumSize
to the the same size as your main size. This gives you max and min icons, and keeps the form the same size.
Upvotes: 0
Reputation: 1
You can let FormBorderStyle be FixedDialog and then set MaximizeBox to False. This will leave only the Minimize and Close buttons active in the upper left of the app window.
Upvotes: 0
Reputation: 3423
Short of implementing a custom title bar and non-client area, you can't do it. As nobugz says, that combination of styles simply isn't supported by Windows. You could roll your own min/max buttons on top of the standard toolwindow title bar, but I don't recommend it.
Upvotes: 0
Reputation: 942099
Windows simply doesn't support it, you can't force it to do otherwise. Fwiw, it isn't your job to force a window style on a netbook machine. The user does this through the Control Panel Display + Appearance tab. It is best to avoid pushing your personal preference on your UI when the user can easily do so herself. And make it consistent for all apps. And keep the min/max buttons.
Upvotes: 2