Microsoft Visual Basic 2010 Step by Step eBook

(Tina Meador) #1

370 Part III Designing the User Interface


Tip The complete Anchor and Dock program is located in the C:\Vb10sbs\Chap14\Anchor
and Dock folder.


  1. Click the Start Debugging button to run the program.


The form opens, just as you designed it.


  1. Move the pointer to the lower-right corner of the form until it changes into a Resize
    pointer, and then enlarge the form.
    Notice that the size and position of the objects on the form do not change.

  2. Return the form to its original size.

  3. Click the Align Now button on the form.


The picture box object is now docked at the top edge of the form. The picture box
is also resized so that its sides adhere to the left and right edges of the form, as
shown here:

Notice that the Sun icon in the picture box is now distorted, which is a result of the
docking process.


  1. Enlarge the form again.


As you resize the form, the picture box and text box objects are also resized. Because
the text box is anchored on all four sides, the distance between the edges of the
form and the text box remains constant. During the resizing activity, it also becomes
apparent that the button object is being repositioned. Although the distance between
Free download pdf