How can I turn off the ControlBox but still have Close in the upper right of a form?

  • Thread starter Thread starter Michael Howes
  • Start date Start date
M

Michael Howes

I know I've done this in the past but can't remember how I did it.
How can I turn off the ControlBox but still have the Close X in the upper
right of a Form?

It's some combo of FixedDialog and ControlBox = false

thanks
mike
 
If you set the FormBorderStyle to FixedDialog and leave the ControlBox set to
true, the dialog should show the Close X but not the "Control Box".

In the particular Form that I checked I also had the MaximizeBox/MinimizeBox
properties set to false and ShowInTaskbar was also set to false.

I've noticed in the past that for some of my dialogs, sometimes the Control Box
shows in the designer but not when you run the app.

Hope this helps
 
If you're just looking to remove the min and max buttons, then you could set
the MaximizeBox and MinimixeBox properties to false.
 
Michael Howes said:
I know I've done this in the past but can't remember how I did it.
How can I turn off the ControlBox but still have the Close X in the upper
right of a Form?

It's some combo of FixedDialog and ControlBox = false

Set 'FormBorderStyle' to 'FixedDialog', 'MaximizeBox' and 'MinimizeBox' to
'False'. At runtime set the form's 'Icon' property to 'Nothing'/'null'.
 
I've noticed in the past that for some of my dialogs, sometimes the
Control Box shows in the designer but not when you run the app.

this is exactly what was happening. Ugh...I had forgotten..that bug has
been in the designer for a long time

mike
 
Back
Top