Board index » cppbuilder » Minimum Form Size

Minimum Form Size

Can anyone tell me how to set the minimum size of a form , so that
TForm->Width is not getting below that value ?

(simple?!)

Thanks in advance

 

Re:Minimum Form Size


Quote
>>Can anyone tell me how to set the minimum size of a form , so that

TForm->Width is not getting below that value ?

In BCB 4 and later you can use the form's Constraints property. For BCB 1
and BCB 3 you'll have to use a message map and catch the WM_GETMINMAXINFO
message. Once you have set up the message map in the form's class
declaration, the handler for WM_GETMINMAXINFO will look something like this:

void __fastcall
TMainForm::OnGetMinMaxInfo(TWMGetMinMaxInfo& Message)
{
  Message.MinMaxInfo->ptMaxTrackSize.x = 500;
  Message.MinMaxInfo->ptMaxTrackSize.y = 360;
  Message.MinMaxInfo->ptMinTrackSize.x = 360;
  Message.MinMaxInfo->ptMinTrackSize.y = 260;
  Message.Result = 0;

Quote
}

--
Kent (TeamB)
C++Builder Developer's Journal
http://www.reisdorph.com

Re:Minimum Form Size


Quote
>>Can anyone tell me how to set the minimum size of a form , so that
>>TForm->Width is not getting below that value ?
>In BCB 4 and later you can use the form's Constraints property. For BCB 1
>and BCB 3 you'll have to use a message map and catch the WM_GETMINMAXINFO
>message. Once you have set up the message map in the form's class
>declaration, the handler for WM_GETMINMAXINFO will look something like this:

>void __fastcall
>TMainForm::OnGetMinMaxInfo(TWMGetMinMaxInfo& Message)
>{
>  Message.MinMaxInfo->ptMaxTrackSize.x = 500;
>  Message.MinMaxInfo->ptMaxTrackSize.y = 360;
>  Message.MinMaxInfo->ptMinTrackSize.x = 360;
>  Message.MinMaxInfo->ptMinTrackSize.y = 260;
>  Message.Result = 0;
>}

I will check that out.
I thought I missed a property for Cb3.
Unfortunately not.

Thank you
Horst

Other Threads