Link to home
Start Free TrialLog in
Avatar of _art_
_art_

asked on

D4 Docking question.

Hello there,

Is there a way to prevent resizing of the window when it is floated? For example when I've floated TToolBar in docking example I cant change its height. Thats what I need with my custom window... I tried to catch WM_WINDOWPOSCHANGED but that seems does not work... Thanks.
Avatar of Pegasus100397
Pegasus100397

Art,

  Try changing the BorderStyle property of the form to anything other than "bsSizeable" (bsDialog would work).

Good luck with your project!

Pegasus
In fact you can only use dialog or single if you want the action you are asking for....

Gabe
Avatar of _art_

ASKER

Thanks! But no that wont work. My docking control inherited from TWinControl so there should be some other way...
Try using setbounds to your default settings  any time the object is repainted and overrride your components paint function

Gabe
Try this:

In your Forms' private section, add this:

procedure WMGetMinMaxInfo(var Msg: TWMGetMinMaxInfo);
                          message WM_GETMINMAXINFO;

Then, in the body of the code, do this:

procedure TForm1.WMGetMinMaxInfo(var Msg: TWMGetMinMaxInfo);
begin
   inherited;
   with Msg.MinMaxInfo^ do begin
      ptMinTrackSize.x:= 799; { Set your dimensions here}
      ptMaxTrackSize.x:= 799; {  and here               }
      ptMinTrackSize.y:= 500; {  and here               }
      ptMaxTrackSize.y:= 500; {  and here <G>           }
   end;
end;

I hope this is what you are looking for.

Best wishes,


Stuart.


Hi, art!
if you use Delphi 4 you can use the Constrains property to set the Min and Max height of a control.
It will have the same effect as Stuart's procedure.
But I'm not sure that it will work while docking.

Avatar of _art_

ASKER

1. Paint procedure -> endless loop.
2. wm_getminmaxinfo -> not of help (I dont mazximize).
3. Constraints -> Bingo!!! :-)

kotik rewrite ur comment as an answer please. :-)
ASKER CERTIFIED SOLUTION
Avatar of kotik
kotik

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial