How can I splite the form into four parts?

  • Thread starter Thread starter honeybee
  • Start date Start date
H

honeybee

How can I splite the form into four parts?

I have already tryed to use the Splitter Component,but it doesn't works.
 
Andy Gaskell said:
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
 
Back
Top