Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
您好我创建了一个表单并将两个 DBGrid 放入表单中。并设置 align Left to right 两者。当我运行程序并最大化窗口 DBGrid 宽度没有改变。我需要将 DBGrid 的宽度都更改为窗口的 50%?
将左侧控件(Control1例如)设置为alLeft,将右侧控件(Control2例如)设置为alClient。OnResize然后在父窗体上创建一个处理程序:
Control1
alLeft
Control2
alClient
OnResize
procedure TForm1.FormResize(Sender: TObject); begin Control1.Width := ClientWidth div 2; end;