Datasheet
Chapter 1: Getting Started
13
Changing the Text of a Label Object
After you position the label object on the form, you can set the text for the label. One of the things that
Visual Studio does automatically is size the label to be just big enough to accommodate the label ’ s text.
Given the default font size used by Visual Studio, the default height for a label is 13 pixels. (A pixel is one
dot, or point of light, on the screen of your display device.) If you change the font size of the label object,
the height of the label is automatically adjusted for you.
Actually, I am not a big fan of automatic sizing of labels. For that reason, I turn off the auto - sizing
feature. To turn off auto - sizing, change the
AutoSize property from True , as shown in Figure 1 - 11 ,
to
False . You may have to scroll down in the Property window to be able to see the AutoSize property
displayed in the Properties window. Click the down arrow at the right end of the textbox to display the
choices you have for the property. In this case you can choose only
True or False . Select False .
The auto - sizing of the label object is now turned off.
Figure 1 - 10
ISBN: 978-0-470-26129-3 I Title: Beginning C# 3.0 : An Introduction to Object Oriented Programming I SKU: 9785CH0009874