Visual Basic 2008 Programming: Business Applications with a Design Perspective
Chapter 1 Chapter 2 Chapter 3 Chapter 4 Chapter 5 Chapter 6 Chapter 7 Chapter 8 Chapter 9
Chapter 10 Chapter 11 Chapter 12 Chapter 13 Chapter 14 Appendix A Appendix B Appendix C Home
Last change: February 13 2016 18:48:19.

 Chapter in PDF

Chapter 2: Visual Basic Programming Concepts
Last change: February 13 2016 18:48:07.

Common Properties

Forms and labels have many common properties. If you carefully examine the Properties window of each object, you should be able to identify quite a few. The following is a short sample list of these common properties and their uses:

Property Uses Default Setting
BackColor Background color. Gray; standard color for buttons
Enabled When set to True, it is accessible by the user; when set to False, it is not accessible to the user. True
Font Font for text displayed in the object. MS Sans Serif 8.25
ForeColor Foreground (text) color. Black; standard text color
Location A pair of numbers representing a coordinate at which the object’s left upper corner is to be aligned.  
Size A pair of numbers giving the width and height of the object.  

Of course, any of these property settings can be changed. You may have noticed that as you move the objects around, the values in their Location property change. Also, as you resize the objects, the values in their Size property also change.
Note also that at run time, you can also set the Left and Top properties (in addition to the Location property) to change the location of an object. For example, the following code will place the left margin of Label1 100 pixels from the left margin of the form (without changing the label’s vertical position or size).
Label1.Left = 100

Last change: February 13 2016 18:48:06.