A particularly useful technique for building a series of similar controls is to build one and then use copy and paste to make others.
For example, to build the name, street, city, state, and ZIP code TextBoxes described in the previous section, you could start by adding the name TextBox to the form. Next, set all of the properties that you want the control copies to share. For example, you may want to adjust the TextBox’s width, set its MaxLength property to 20, and set its Anchor property to Top, Left, Right so it resizes horizontally when its container resizes. Now select the control on the designer and press Ctrl+C to copy it. Then press Ctrl+V repeatedly to make copies for the other controls. Drag the controls into position and you have quickly built all of the controls with their shared properties already set.
You can also use copy and paste to copy a group of controls. For example, suppose you want to make name, street, city, state, and ZIP code TextBoxes but you also want Label controls to the left of the TextBoxes. First create the name Label and TextBox, set their properties, and position them so their baselines are lined up and the Label is to the left of the TextBox as desired. Click and drag to select both controls and then press Ctrl+C to copy them both. Now when you press Ctrl+V, the designer makes a copy of the Label and the TextBox. The copies have aligned baselines and the Label is to the left of the TextBox as in the originals. The new controls are even both selected so you can use the mouse to grab them both and drag them into position.
3.16.79.147