Docking with many TextBox controls

I am working on a science fair project and I really need to move forward at the anchor. I have worked for a couple of days on snapping this window and I cannot figure out how to change all these qualities.

Can someone tag this image with anchors and explain how they work in a way that would make sense for a 12 year old?

enter image description here

+3


source to share


1 answer


I marked the required ones Anchors

in colors

You will need a little code in addition to the anchors as Anchors

it cannot handle more than one control in relation to the bounds of its parent. In your layout, you have three groupBoxes (presumably) separating the center of the form. You can also calculate dist

if you like ..

labeled layout



Here's a piece of code to get you started with GroupBoxes:

private void Form1_Resize(object sender, EventArgs e)
{
    int dist = 3;  // set to the distance between the GroupBoxes!
    int width = (oneWideTextBox.Width - dist * 2) / 3;
    groupBox1.Width = width ;
    groupBox2.Left = groupBox1.Right + dist;
    groupBox2.Width = groupBox1.Width;
    groupBox3.Left = groupBox2.Right + dist;
    groupBox3.Width = groupBox1.Width;
}

      

Of course, I've made some assumptions about how you want this to work. Hope you can take it from here! Feel free to ask !!

+3


source







All Articles