2

On one of my forms the Minimize/Maximize Buttons are gone. The ControllBox is set to true as is the MaximizeBox and MinimizeBox.

Is there some other setting I have missed?

Gorgsenegger
  • 7,356
  • 4
  • 51
  • 89
Drago87
  • 105
  • 1
  • 11

3 Answers3

3

Check your FormBorderStyle on that form,

FixedToolWindow and SizableToolWindow and None doesn't have those controls at all.

madoxdev
  • 3,770
  • 1
  • 24
  • 39
2

Coming late to the game, I still would like to share my answer as I spent a good couple of hours searching for a fix. My form had all the properties set as they should, but still the minimize/maximize buttons wouldn't show.

The culprit was overriding the CreateParams method from my form, e.g.

    protected override CreateParams CreateParams
    {
        get
        {
            CreateParams Params = base.CreateParams;
            Params.ExStyle |= 0x80;
            return Params;
        }
    }

My original intention of overriding this method was to hide my app from the task switcher (alt-tab). I didn't think of this as the reason for not showing the buttons mentioned above, alas, it was.

For further reference, here is the documentation of the flags.

Gorgsenegger
  • 7,356
  • 4
  • 51
  • 89
0

In my project, the FormBorderStyle was already set to FixedSingle. So, I was not sure why the MinimizeBox/ MaximizeBox were still not visible. Then, somehow, I managed to find an alternative solution for this.


Inside of your C# project, simply press: Ctrl+Shift+F buttons, then search for the MinimizeBox/ MaximizeBox variables.

I was surprised to find its value set to False at first. So, to fix, I simply changed the value from False -> True then, problem solved.


In my case, since it is an open source project, the author has changed its value. So, I just need to find those variables using the Find in Files function by Microsoft Visual Studio. It can also be found in the Microsoft Visual Studio's menu bar: Edit -> Find and Replace -> Find in Files.
enter image description here

Hopefully useful for all of you as well!

ewu11
  • 65
  • 9