Link to home
Start Free TrialLog in
Avatar of __alex
__alex

asked on

More splitter woes

Hi,

my form looks like this:
------------------------------
Panel1   Splitter1   Panel2
alClient  alRight     alRight
------------------------------
If I change the parent property of the form (Nil -> TabSheet) my controls get messed up. If the size of the TabSheet is different than the size of my form I expect my controls to resize but they don't. Actually I use Form1.Width := Form1.Width - 1 to get it done but that's goofy. Any hint apprechiated.

Thanks in advance.
Avatar of __alex
__alex

ASKER

Oops, forgot to mention:
I set the Splitter1.Visible property in the OnFormHide and OnFormShow event <--- https://www.experts-exchange.com/questions/21092429/Splitter-woes.html
ASKER CERTIFIED SOLUTION
Avatar of esoftbg
esoftbg
Flag of Bulgaria image

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
Avatar of __alex

ASKER

I guess that's what I do :-(
I will come back to you on Monday. Have a nice weekend!
SOLUTION
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
Avatar of __alex

ASKER

Back in the office again...

I guess I have to apologize again: I forgot to mention I already do align the form:

procedure TForm2.SpeedButton1Click(Sender: TObject);
begin
  Parent := Form1.TabSheet1;
  Splitter1.Left := Panel2.Left - Splitter1.Width - 2;
  Form2.Align := alClient;
end;

procedure TForm2.SpeedButton2Click(Sender: TObject);
begin
  Parent := nil;
  Splitter1.Left := Panel2.Left - Splitter1.Width - 2;
  Form2.Align := alNone;
end;

If Panel2.Width is greater than the width of the tabsheet and I make the panel appear in the tabsheet the splitter is sort of "under" Panel2. Furthermore this does not happen with D7 but with D5. I guess I stay with my "Form1.Width := Form1.Width - 1" workaround and close this question. Thanks for your effort!

Alex