Fuy

,Shows an example of the font and foreground and background color of the control

Specifies that the control resizes when the form is resized

Enables users to enter multiple lines of text in a control

Figure 6.1 - Display properties for the StartDate TextBox control.

When you add a control to a form, the control is given a default name such as TextBoxl, LabeM, and so on. If you'll be referencing the control in Microsoft Visual Basic Scripting Edition (VBScript) procedures for the form, it's a good idea to give the control a unique name, as shown previously in Figure 6-1.

Change Foreground and Background Colors

The background or foreground color for a control corresponds to the color specified for the component on the Appearance tab of the Display icon in Windows Control Panel. As shown earlier in Figure 6-1, the foreground color of the StartDate control is set to Window Text, so the color of the foreground text in the StartDate control matches the color of Wndow text in the Display Properties dialog box. Similarly, the background color of the StartDate control matches the color defined for Window. If you have Wndow defined as green on your system, the background of the control is green.

To set foreground and background colors for a control

1. Right-click the control, and then click Properties.

2. Click the Display tab.

3. In the Foreground Color or Background Color drop-down list box, click the component to which you want to map the control.

The Vacation Request form shown in Figure 6-2 provides a good example of how color effects can be achieved on a form. The background color for the Label8 control is set to Button Shadow so that it will have a dark gray color for almost all users. Also, many of the controls on the form have a white background. In this case, the background color is set to Window, which maps to white in the Wndows Control Panel. Notice that most of the controls actually sit on top of the Label8 control. Controls are layered in Design mode, using Bring To Front and Send To Back options from the icons in the Form Design toolbar. For this form, the Label8 control is sent to the back layer of the page.

Generally, you can make a dark gray background for a control by setting the background color to Button Shadow. You can make a white background by setting the background color to Window.

Layer Controls

The Label8 control on the Vacation Request form provides a good example of how you can layer controls on a form. As shown In Figure 6-2, several controls, such as StartDate and EndDate, are located on top of the Label8 control. This Is done by using the Send To Back and Bring To Front buttons on the Form Design toolbar. With these buttons, you can layer controls by bringing them to the front layer or sending them to the back layer.

Figure 6.2 - The Vacation Request form. To send a control to a back layer

® Click the control, and then click the Send To Back button on the Form Design toolbar, or select Order from the Layout menu. To bring a control to a front layer

Click the control, and then click the Bring To Front button on the Form Design toolbar, or select Order from the Layout menu.

For more Information about setting control display properties, see "Set Control-Specific Properties" later in this chapter.

Was this article helpful?

0 -1

Post a comment