Controls and Properties / AutoSize Property
Subtitles of the Movie
In this movie I will discuss a property that's called AutoSize. Now not every control has this property associated with it. In particular, there are three controls that I will take a look at, a label, a radio button, and a check box. Each of these three controls does have the AutoSize Property associated with it. Let's take a look how these can affect the controls. Now if you go to the Properties window, you will see that there is an AutoSize Property associated with the label. And by default, this AutoSize Property is set to true. This means that as the contents of the label adjust, bigger or smaller, the label itself will also expand or contract. To help illustrate this, I will change the border style from none to Fixed 3D that way we will be able to see this a little bit easier. So at design time, as I click on this label, and then move down to the Text Property and adjust the contents of the label, for example ÒThis is a bigger label.Ó As you can see, the AutoSize Property automatically adjusts. If I were to delete that entire text, the AutoSize Property causes the label to completely disappear virtually except for the border. To change this feature, you can change the AutoSize Property to false. This means that the AutoSize functionality is not in effect and now the label's size is controlled by you the programmer. As you can see now you can physically manually move the label to be whatever size you wish it to be. Now the Radio Button and Checkboxes behave in a similar fashion, again, choosing the Radio Button you see there is an AutoSize property set to true. If I were to go to the Text Property and delete the contents of the Text Property for the Radio Button as you can see, the AutoSize Property is causing this control to shrink down to the bare minimum which in this case is the Radio Button itself. If I were to change this AutoSize Property to false I'd now have the ability to control this manually. And the Check Box works in the same manner, AutoSize Property by default is true. Change the text contents and the AutoSize Property takes effect. Change AutoSize Property to false and now you have the ability to work with it.
Tutorial Information
| Course: | Microsoft Visual Basic 2005 |
| Author: | Arthur Lee |
| SKU: | 33940 |
| ISBN: | 1-935320-10-6 |
| Release Date: | 2008-11-19 |
| Duration: | 7.5 hrs / 97 lessons |
| Work Files: |
Yes |
| Captions: | Available on CD and Online University |
| Compatibility: |
Vista/XP/2000, OS X, Linux QuickTime 7, Flash 8 |
VTC Sign up & Benefits
- Unlimited Access
- 81,350 Video Tutorials (20,800 free)
- Video Available as Flash or QuickTime
- Over 782 Courses
- $30 for One Month Access
- Multi-User Discounts Available
United States 