Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is my TSplitter in the wrong place?

I've got a dialog that's laid out something like this:

---------------------------------------------
|                                           |
| CONFIG AREA                               |
| Align: alTop                              |
--------------------------------------------- <-static boundary
|                                           |
| DISPLAY AREA 1                            |
| Align: alTop                              |
============================================= <-TSplitter Align: alTop
|                                           |
| DISPLAY AREA 2                            |
| align: alClient                           |
--------------------------------------------- <-bottom of dialog

However, at runtime, the splitter doesn't show up between Display Area 1 and Display Area 2, but between Config Area and Display Area 1, leading to some annoying interface problems. There's nothing in the form's setup-related event handlers that alters the Visible or Align properties of any of these components. Does anyone know why the splitter isn't loading in the place it's positioned at in the form designer?

like image 598
Mason Wheeler Avatar asked Mar 11 '11 18:03

Mason Wheeler


1 Answers

(Can't reproduce.) Splitters are tricky things. I always write code to position them. In this case, I would do

procedure Form1Show(Sender: TObject);
begin
  Splitter1.Top := DisplayArea2.Top;
end;
like image 72
Andreas Rejbrand Avatar answered Sep 19 '22 22:09

Andreas Rejbrand