Datasheet

Chapter 1: Getting Started
15
(Figure 1 - 13 is only large enough to show the last word typed into the Text property in the Property
window. When you look at the label in the Source window, all three words appear in the label object.)
By default, the text of a label object is positioned so it appears in the upper left - hand corner of the label.
If
AutoSize is set to True , you can t position the text with the label object; it s set for you automatically.
However, because you turned off auto - sizing, you can position the text within the label wherever you
wish. Figure 1 - 14 shows how to do this using the
TextAlign property. If you look closely at Figure 1 - 14 ,
you can see that
TextAlign is currently set to TopLeft . There are nine positions where you can place
the text in a label that you can resize. You want to right - justify your text in the center of the label object.
If you look where the cursor is positioned in Figure 1 - 14 , clicking that box right - justifies the text in the
label object.
Figure 1 - 13
Figure 1 - 14
ISBN: 978-0-470-26129-3 I Title: Beginning C# 3.0 : An Introduction to Object Oriented Programming I SKU: 9785CH0009874