I want to have a form resize proportionally when the user resizes it. I have done this in the event OnCanResize with the following code:
NewHeight := Round(Height / Width* NewWidth);
To prevent the user maximizing the form by clicking the maximize button I managed to disable it treating the message WMSysCommand with the following code :
if (AMsg.CmdType = SC_MAXIMIZE) then MessageBeep(0);
What I have not managed to do is to prevent maximizing the form when the user double clicks on the title bar. Is there any way to do it in Delphi?
I hope it is clear that I don't want to prevent the user from resizing the form. I just want to prevent resizing when clicking the maximize button and double clicking the title bar.