> Is it possible to define a TFolderPage using the IDE like a TForm and than
> add it dynamically to a TFolder control ?
There is a trick I'm using:
- Make your main form the first form of your project, to make it available
as Application:oMainForm in the whole program.
- Design the forms as usual, but don't change any property of it, excepting
nleft, ntop, nwidth and nheight
- Modify the CLASS declaration from:
CLASS TForm1 FROM TForm
to:
CLASS TForm1 FROM TFolderForm
- Put the following code in any .prg of your project (you can create a new
..prg if you want):
//---------------------------------------------------------- --------------------
CLASS TFolderForm FROM TFolderPage
DATA nFormType
METHOD New( oParent )
METHOD CreateForm() VIRTUAL
METHOD Close() INLINE ::Delete()
ENDCLASS
//---------------------------------------------------------- --------------------
METHOD New( oParent ) CLASS TFolderForm
// Change oFolder1 to the apropiate name
Super:New( Application:oMainForm:oFolder1 )
::CreateForm()
::Select()
::SetFocus()
RETURN Self
//---------------------------------------------------------- --------------------
- To call the form, do it as usual, but without calling :Show() or
:ShowModal(). I.e.:
TForm1:New()
- Notice that now it's not a form, but a folder page, so be careful using
it. I.e., don't call ShowModal(), don't use default or cancel buttons on it,
etc.
That's all

--
Regards,
Jose F. Gimenez