30.04.2017 Views

4523756273

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

258<br />

Part IV: Communicating with Your Users<br />

Properties for controls include the following:<br />

✓ Name<br />

✓ Width<br />

✓ Height<br />

✓ Value<br />

✓ Caption<br />

Each control has its own set of properties (although many controls have<br />

some common properties). To change a property using the Properties<br />

window:<br />

1. Make sure that the correct control is selected in the UserForm.<br />

2. Make sure the Properties window is visible (press F4 if it’s not).<br />

3. In the Properties window, click on the property that you want to<br />

change.<br />

4. Make the change in the right portion of the Properties window.<br />

If you select the UserForm itself (not a control on the UserForm), you can use<br />

the Properties window to adjust UserForm properties.<br />

Chapter 17 tells you everything you need to know about working with dialog<br />

box controls.<br />

Some of the UserForm properties serve as default settings for new controls<br />

you drag onto the UserForm. For example, if you change the Font property for<br />

a UserForm, controls that you add will use that same font. Controls that are<br />

already on the UserForm are not affected.<br />

Viewing the UserForm Code window<br />

Every UserForm object has a Code module that holds the VBA code (the<br />

event-handler procedures) executed when the user works with the dialog<br />

box. To view the Code module, press F7. The Code window is empty until you<br />

add some procedures. Press Shift+F7 to return to the dialog box.<br />

Here’s another way to switch between the Code window and the UserForm<br />

display: Use the View Code and View Object buttons in the Project window’s<br />

title bar. Or right-click the UserForm and choose View Code. If you’re viewing<br />

code, double-click the UserForm name in the Project window to return to the<br />

UserForm.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!