Discussion:
Form Sizing
(too old to reply)
Barry
2008-04-09 18:13:58 UTC
Permalink
Can't believe I need to ask this, but I cannot find the method to control
this.

How do you lock the size of a form, and make it such that there is no
"Maximum" control in the top right corner?

I thought AutoResize set to False did it, but seemingly not.

Thanks

Barry
Barry
2008-04-09 18:18:29 UTC
Permalink
Post by Barry
How do you lock the size of a form, and make it such that there is no
"Maximum" control in the top right corner?
Maximize Control (not maximum control)
Post by Barry
Can't believe I need to ask this, but I cannot find the method to control
this.
How do you lock the size of a form, and make it such that there is no
"Maximum" control in the top right corner?
I thought AutoResize set to False did it, but seemingly not.
Thanks
Barry
Vladimir Stefanovic
2008-04-09 20:39:20 UTC
Permalink
Post by Barry
How do you lock the size of a form, and make it
such that there is no "Maximum" control in the
top right corner?
Look at TForm::BorderStyle and bsDialog.
--
Best Regards,
Vladimir Stefanovic
Barry
2008-04-10 08:01:36 UTC
Permalink
Thanks Vladimir

I used the following code, which although did not remove the Maximize
Button, it disabled it.

All the other "design time" options under BorderStyle removed the
Minimize button as well as the Maximize button. (I still need the
Minimize button, and the Close button.)

Many thanks

Barry

//----------------------------------------------------
void __fastcall TMainForm::FormCreate(TObject *Sender)
{
TBorderIcons tempBI = BorderIcons;
tempBI >> biMaximize;
BorderIcons = tempBI;
}
//----------------------------------------------------
Post by Vladimir Stefanovic
Post by Barry
How do you lock the size of a form, and make it
such that there is no "Maximum" control in the
top right corner?
Look at TForm::BorderStyle and bsDialog.
Remy Lebeau (TeamB)
2008-04-10 08:39:01 UTC
Permalink
Post by Barry
I used the following code, which although did not
remove the Maximize Button, it disabled it.
You can setup the BorderIcons at design-time instead of in code.
Post by Barry
All the other "design time" options under BorderStyle removed
the Minimize button as well as the Maximize button. (I still need
the Minimize button, and the Close button.)
You cannot remove the Maximize button without also removing the Minimize
button. The only way to get around that is to remove both buttons and then
owner-draw the caption bar manually. Otherwise, you will just have to live
with the Maximize button being visible but appearing disabled.
Post by Barry
void __fastcall TMainForm::FormCreate(TObject *Sender)
Do not use the OnCreate event in C++. It is a Delphi idiom that can cause
illegal behavior in C++. Use the actual constructor instead.


Gambit
Barry
2008-04-10 10:21:45 UTC
Permalink
Post by Remy Lebeau (TeamB)
Post by Remy Lebeau (TeamB)
Do not use the OnCreate event in C++. It is a Delphi idiom that can cause
illegal behavior in C++. Use the actual constructor instead.
Many thanks for the advise Remy...as always a gem of knowledge

Yes, I will live with the disabled, but visible Maximize button, thanks

Barry
Post by Remy Lebeau (TeamB)
Post by Remy Lebeau (TeamB)
I used the following code, which although did not
remove the Maximize Button, it disabled it.
You can setup the BorderIcons at design-time instead of in code.
Post by Remy Lebeau (TeamB)
All the other "design time" options under BorderStyle removed
the Minimize button as well as the Maximize button. (I still need
the Minimize button, and the Close button.)
You cannot remove the Maximize button without also removing the Minimize
button. The only way to get around that is to remove both buttons and then
owner-draw the caption bar manually. Otherwise, you will just have to live
with the Maximize button being visible but appearing disabled.
Post by Remy Lebeau (TeamB)
void __fastcall TMainForm::FormCreate(TObject *Sender)
Do not use the OnCreate event in C++. It is a Delphi idiom that can cause
illegal behavior in C++. Use the actual constructor instead.
Gambit
Loading...