Manipulating Controls


Chapters 10 and 11 gave you substantial exposure to selecting, moving, resizing, aligning, and otherwise manipulating controls. Nevertheless, I thought it would be useful to summarize in one place the various techniques available to you.

Selecting

You select a control by clicking directly on it. The control displays a moving handle and sizing handles. If you select a text box with an attached label, the label's move handle also is displayed. If you select the label, the text box's move handle is visible (see Figure 12.19).

Figure 12.19. The currently selected object is the label, so only the text box's move handle is displayed.


A selected control has several sizing handles. You use the sizing handles that border the control to resize it. You use the move handle in the upper-left corner to move the control.

You can also select any control from the drop-down list in the Object Selector (see Figure 12.19). If you haven't given the object a meaningful name, however, this method could prove difficult. To name a control, right-click it; choose Properties, Other tab; and type a name in the Name property.

To deselect a control, click outside it. Make certain you are not selecting any other element.

You can select several controls at the same time by these methods:

  • Click the first control, press Shift, and click the other controls. You can use this method for controls that are either contiguous or far-flung. When you select text boxes, this method displays all handles of the text boxes and the move handle of the labels.

  • Click anywhere outside the controls and draw a rectangle around them (the rectangle does not stay visible). This method displays all handles of all controls within the rectangle, not only the text boxes (see Figure 12.20).

    Figure 12.20. When you want to display all the handles of both text boxes and their accompanying labels, draw a rectangle around them and release.


  • Move the pointer to the vertical or horizontal ruler. When it becomes a right or down arrow, respectively, click to select all the controls in the row or column (I'm speaking figurativelythere is no formally defined row or column). When you select text boxes, this method displays all handles of the text boxes and the move handle of the labels.

NOTE

You can group controls so that they stay together and can be resized as a group. Select the fields and choose Format, Group. If you use the Shift+click method, the text boxes are grouped; if you use the method of drawing a rectangle around them, both text boxes and labels will be grouped. Choose Format, Ungroup to ungroup controls.


Resizing

To resize a control, move your mouse pointer to any sizing handle. When the pointer becomes a double arrow, drag it. Sizing handles in the middle of the control reduce or increase either the length or the height. Sizing handles at the corners resize both dimensions at the same time.

NOTE

As an alternative to using sizing handles, you can use the control's property sheet. Right-click the control and choose Properties, Format tab. Edit the properties for Width and Height.


You can use the Format, Size, To Fit command to get a best fit for the text string in a label. This command doesn't work in a text box, however, because its values vary in length.

You can resize a control grid line by grid line. Select the control and, while pressing Shift, tap the corresponding arrow key to lengthen, widen, or reduce dimensions.

Moving

To move a text box with an attached label, hover the pointer at any border, away from any handle. When the pointer becomes an open hand, drag the text box; the label follows (see Figure 12.21).

Figure 12.21. You use the open-hand pointer to move a text box and its accompanying label.


To move either the text box or the label separately, hover the pointer over the respective move handle. When the pointer becomes a pointing finger, drag the control (see Figure 12.22).

Figure 12.22. You use the pointing-finger pointer to move a label or text box alone.


You can also move a control grid line by grid line. Select the control and press the corresponding arrow key. If you want to nudge the control just a wee bit, press Ctrl while you press the corresponding arrow key.

Spacing

The Format menu also has commands that adjust horizontal and vertical spacing. In Figure 12.23, the three controls have unequal vertical spacing. In Figure 12.24, the three controls have been selected and the Make Equal command from the Vertical Spacing submenu of the Format menu has been applied. Note that the top and bottom label/text box pair has remained stationary, while the middle controls have moved upward.

Figure 12.23. The three controls are not equally spaced.


Figure 12.24. You use the Make Equal command to balance the spacing between controls.


You can increase or decrease the spacing between controls by selecting them and using the applicable command from the Vertical Spacing and Horizontal Spacing submenus.

Align

The Align command on the Format menu enables you to align controls to the left, right, top, or bottom. In each case, you must select two or more controls. You can think of the control to which Access aligns as the one with the "mostest." For example, if you select three controls and choose Format, Align, Left (see Figure 12.25), Access aligns two controls to the third that is leftmost (see Figure 12.26).

Figure 12.25. The Align commands help you line up controls. Here the MerchID and MerchName text boxes will be aligned left in relation to the MerchDescription text box.


Figure 12.26. The MerchID and MerchName text boxes are now aligned left with the MerchDescription text box.


The Grid

In the background of the form and report design areas is a grid, a scheme of dots. The menu selection View, Grid toggles the grid on and off. New controls will be aligned to the grid, provided that Format, Snap to Grid (another toggle) is selected. Occasionally, you will want to turn off Snap to Grid so you can position controls exactly where you want them.

You can set the number of grid lines per unit of measurement (usually an inch) using the Grid X and Grid Y properties on the Format tab of the Form property sheet.




Hands-On Microsoft Access(c) A Practical Guide to Improving Your Access Skills
Hands-On Microsoft Access: A Practical Guide to Improving Your Access Skills
ISBN: 0321245458
EAN: 2147483647
Year: 2005
Pages: 169
Authors: Bob Schneider

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net