Label

Used to convey information back to the user, the Label control looks similar to what you see in Figure 3-13 when you place it on a UserForm.

Typically, you use this type of control to display error messages, entity counts, etc. Labels prove most useful when you control them at run time by changing the Caption property, as in the following snippet:

Private Sub UserForm_Activate()

Label1.Caption = "# of Blocks = " & ThisDrawing.Blocks.Count End Sub

Executing this bit of code produces the dialog box output shown in Figure 3-14. When you use a Label control, you may need to adjust the Label1.Width and/or

Label1.Height properties to compensate for the amount of text to be displayed.

ICheckBoxI

Figure 3-12. The

Toolbox window

Figure 3-13. A UserForm with a Label control

Figure 3-14. A UserForm at run time with a Label control

Figure 3-13. A UserForm with a Label control

Figure 3-14. A UserForm at run time with a Label control

Was this article helpful?

0 0

Post a comment