Bart Kindt 5 Posted 8 hours ago I have a simple test Form with two TMemo's. The top TMemo align is set as alClient. The second is set as alBottom. In between I put a TSplitter. I want to set the vertical position of the splitter at runtime. Basically, I want to save the form, and later load it so the two Memo's are set as the User may have set them before. No matter what I try, I cannot make the Splitter or either of the Memo's to change size (vertically). They do not respond to any runtime setting of 'Top', Height, etc. Really, if I set the bottom TMemo.Top at a position, the top TMemo should automatically change size to accomodate. Does not work. I must be missing something totally obvious. unit Unit2; interface uses Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.ExtCtrls, Vcl.StdCtrls; type TForm2 = class(TForm) Memo1: TMemo; Memo2: TMemo; GroupBox1: TGroupBox; Button1: TButton; Splitter1: TSplitter; procedure Button1Click(Sender: TObject); private { Private declarations } public { Public declarations } end; var Form2: TForm2; implementation {$R *.dfm} procedure TForm2.Button1Click(Sender: TObject); begin Splitter1.top := 100; // Does not work Memo2.top := 100; // Does not work Memo1.Height := 100; // Does not work end; end. Share this post Link to post
dummzeuch 1628 Posted 7 hours ago You must set the height of the memo with alBottom. Everything else will adjust automatically (unless the splitter acts up then it will be moved above the memo with alClient 😞 in that case you can hopefully set the splitter's top position to move it back between the memos where it belongs). 1 Share this post Link to post
Bart Kindt 5 Posted 3 hours ago Uh. I don't understand what you are saying. Show me what you mean in the code? Share this post Link to post