views:

56

answers:

1

Hello,

I have two forms(one main form,and one submain form).I'd like to do something like CodeGear's IDE panels on drag-and-drop.Meaning I could move them and they merge with other components.

However,I'm asking for something different:

I'd like to drag the submain form into the main form and to turn it into a something like TFrame or,in other words,something that doesn't move,but stay static.And reverse - I'd like to alo be able to get the form out of the TFrame by any chance.

Is my idea possible and if it is,could you explain how to accomplish it?

EDIT: An idea came to my head.Is it possible to create a TFrame that inherits all controls/components from a TForm so that components stay on the form,but when I attempt to turn it into Tframe,it just changes visibility to false and shows the TFrame contaning everything from the Form.Is that possible?

+1  A: 

Set the main form's DockSite property to True, and then handle the OnDockOver and OnDockDrop events.

You can see an example of the VCL's drag and drop docking support in the Docking demo (installed for Delphi 2007 on WinXP in C:\Documents and Settings\All Users\Documents\RAD Studio\5.0\Demos\DelphiWin32\VCLWin32\Docking, for Delphi 7 in C:\Program Files\Borland\Delphi7\Demos\Docking.) Delphi 2009's will be in the same folder location as Delphi 2007's; just change the 5.0 to 6.0 in the path.

Ken White