Board index » delphi » Form Creation (TSplitter)

Form Creation (TSplitter)

Quote
> If I make this form auto-created, following line in Source
> "Application.CreateForm(TForm, Form);", then everthing is ok.
> That meens the two Splitters are created.

> But when I want to create the form myself during run-time, "  Form :=
> TForm.Create(Application);", then the two splitters are not created.

Is your code really Form := TForm.Create(Application)?  If so then you're
creating a base tForm, not the descendant form that you've designed in the
IDE by dropping components on it.  I have no problem creating forms with
splitters at runtime.  If this doesn't help please post some actual code
that doesn't work.

-Mike

 

Re:Form Creation (TSplitter)


I Have done the following:

In the FormCreate procedure I wrote the following lines:
----------------------------------------------------------------------------
-
  Splitter1 := TSplitter.Create(Form);
  Splitter1.Parent := Form;
  Splitter1.Left := Forms.Left + Forms.Width + 1;
  Splitter1.Align := alLeft;
  Splitter1.MinSize := 20;

  FormItems.Left := Splitter1.Left + Splitter1.Width + 1;
  FormItems.Align := alLeft;

  Splitter2 := TSplitter.Create(Form);
  Splitter2.Parent := Form;
  Splitter2.Left := FormItems.Left + FormItems.Width + 1;
  Splitter2.Align := alLeft;
  Splitter2.MinSize := Splitter1.Width + 20;

----------------------------------------------------------------------------
-
'Splitter1' and 'Splitter2' will be created when the form is created.

'Forms' and 'FormItems' are created at design-time.

If I make this form auto-created, following line in Source
"Application.CreateForm(TForm, Form);", then everthing is ok.
That meens the two Splitters are created.

But when I want to create the form myself during run-time, "  Form :=
TForm.Create(Application);", then the two splitters are not created.

Can someone help me with this?

Thanks in advance

Other Threads