INTRODUCTION:-

A label is a control that serves as a guide to the user. It provides static text that the user cannot change but can read to get information on a form. The programmer can also use it to display simple information to the user. Most controls on the form are not explicit at first glance and the user may not know what they are used for. Therefore, you can assign a label to a control as a help to the user.
To add a label to a container, click the Label button from the Toolbox and click the object that would host it. You can also dynamically create a label. A label is based on the Label class that is based on the Control class.
CHARACTERISTICS OF A LABEL:-
The most important characteristic of a label control is the text it displays. This is what the user would read. The text of a label is its Text property and is its default. To set a label’s caption, after adding the control to a container, click Text in the Properties window and type the desired value. As we mentioned when studying controls characteristics, at design time, the text you type in the Text field is considered “as is”. If you want to create a more elaborate and formatted string, you would have to do it programmatically.
After adding a label to a form, by default, it receives a fixed size. If you type its caption and press Enter, the text you provided would be confined to the allocated dimensions of the control. If the text is too long, part of it may disappear. You can then resize the label to provide more area. Another solution is to automatically resize the label to accommodate the length of the string you typed. This is aspects is controlled by the Boolean AutoSize property. Its default value is False. If you set this property to True, a rectangular border appears around it. If you type a string in the Text field and press Enter, the control would be resize to show the whole string but using only the necessary space.
Before or after typing the caption of a label whose AutoSize property is set to False, you can resize its allocated space to your liking. This is because a string occupies a rectangular area.
To click label and choose properties and choose text align to set:-
CODING:-
Label1.Text = " WINDOW FORM";
To joining Text
Label1.Text +="WINDOW FORM";
No comments:
Post a Comment