Dear All …
You may create an application for GUI without MDI Form related due to has an animation when creating or resizing like maximize or minimize on it … but we have another tricky to reduce the animation on MDI Form … another posts …
Now, we talk about Frame …
Frame is inheritance from TForm class, you may use as usual, but this TFrame doesn’t have event onShow and onHide, so we can tricked it when it created.
Frame is different with Form, when from call using myForm.show event, but how about Frame ??? you never find it when type Frame. (dot) ..
Here … create the frame is :
var F: TFrame; begin F := TFrame.Create(Self); F.Parent := Panel1; end;
Now, for example, how about you have one label to make it move into right of Frame when your frame is resized ???
When you trigger the frame when it created, you may never get you want, the label will move into right position when it frame is created, but when you showing it, the label never moving into correct position…
But, don’t be panic if you cannot get what you want… you may get trick at your frame using messages.
Put at private sections :
procedure CMShowingChanged(var M: TMessage); message CM_SHOWINGCHANGED;
then , complete the procedure like this :
procedure TFrame1.CMShowingChanged(var M: TMessage); begin inherited; if Showing then begin // ... put your onShow code here end else begin // ... put your onHide code here end; end;
That’s all falks … next posts will how to avoid the animation on MDIChild form
Have a nice coding,