"Andy Gaskell" <pubb AT hotmail DOT com> a écrit dans le message de
news:ub**************@TK2MSFTNGP09.phx.gbl...
I think what you want to do is add 4 (3 would also work) panels to your
Form (Splitters would be optional) and set the Dock property of each panel
accordingly.
I have tried this, and it doesn't works :o(
So, you have to do it by hand :
private void resize(object sender, EventArgs e)
{
/***********
* LT * RT *
***********
* LB * RB *
**********/
int x = myPanel.ClientSize.Width;
int y = myPanel.ClientSize.Height;
int xT = x / 2;
int xB = x / 2;
int yL = y * 5 / 12 - minDistY * 2 / 3;
int yR = y * 5 / 12 - minDistY * 2 / 3;
LTpanel.Location = new Point(0, 0);
LTpanel.Width = xT;
LTpanel.Height = yL;
LTpanel.Anchor = AnchorStyles.Left | AnchorStyles.Top;
RTpanel.Location = new Point(xT, 0);
RTpanel.Width = x - xT;
RTpanel.Height = yR;
RTpanel.Anchor = AnchorStyles.Right | AnchorStyles.Top;
LBpanel.Location = new Point(0, yL);
LBpanel.Width = xB;
LBpanel.Height = y - yL;
LBpanel.Anchor = AnchorStyles.Left | AnchorStyles.Bottom;
RBpanel.Location = new Point(xB, yR);
RBpanel.Width = x - xB;
RBpanel.Height = y - yR;
RBpanel.Anchor = AnchorStyles.Right | AnchorStyles.Bottom;
}
Perhaps it is not the better way, but at least it works :o)
(Note : don't forget the myPanel.Resize += new EventHandler(resize); )
HTH