Anchors won't help here. You are looking for something more akin to the Align
property. But none of the built-in options can do this layout. So, I think you are best writing a bespoke OnResize
handler.
I suggest that you put the charts in a container, say a panel. Assuming that you want the charts to fill the panel in a two by two grid, then you write the following in your panel's OnResize
event handler:
var
W, H: Integer;
....
W := Panel.ClientWidth;
H := Panel.ClientHeight;
Chart1.SetBounds(0, 0, W div 2, H div 2);
Chart2.SetBounds(W div 2, 0, W - W div 2, H div 2);
Chart3.SetBounds(0, H div 2, W div 2, H - H div 2);
Chart4.SetBounds(W div 2, H div 2, W - W div 2, H - H div 2);
You can tweak the layout as you please, but the basics of using OnResize
are the same.
OnResize
event of the form. - TLama