Form and Properties on VB


FORM AND PROPERTIES ON VB

Form a working window in VB useful as worksheets . In the form we instill bias controls such as textbox , label , CommandButton , etc. . When we memebuat project in VB , we need our form as a worksheet . In addition to the window / worksheets , forms can also serve as a dialog box , and the warning window . At the time of the closed form closing events will be run . This situation makes it possible to provide an explanation closure form .

Code Structure on Form

Strukutr code on the form there are three , namely :

o General declaration
This section is used for explicit Declaration Option , Option base , types , and variables that can be used orm level ( subroutine ) pad both public and private levels . This section is located at the top of the coding window .

o General procedure
This section is a subroutine or function dibuata users . This section ditamdai with (general ) , and the name of the subroutine .

o Event procedure
This section is a subroutine that is used to handle events caused by user actions to control tertewntu . Marked by name and type eventnya control .

Put and set the controls on the form

Toolbox is a program controls are used to design a windows application form . For example : button , label , textbox etc. .
1 . move objects
There are 2 ways:
a. By using the mouse
b . By using a combination of Ctrl and other keys according to what we need

2 . Changing the size of an object
The size can be changed by using the mouse or if you want more precise , we can change the size of the window properties.

3 . Duplicate and Cutting Object
Using the copy function ( Ctrl + C ) or Cut ( Ctrl + X ) and can be used to display the results of the function paste ( Ctrl + V ) .

4 . deleting Objects
By using the Shift or Ctrl function to select the object to be removed . And function DEL to remove it .

      Properties

Property is a form of information concerning the controls ( objects ) are created and set up controls for the benefit of programming to be made .
Some examples of property form is : Property Left , Top, Width and Height , Property Fore Color and Back Color , Font Property , Property Caption and Text , Enabled and Visible Property , tabstop and TabIndex Property , and Property and MouseIcon MousePointer and Property Tag .
Property is located on the right worksheet in vb window , which is the most frequently used component in any form is [ caption ] .

a. Property Left , Top, Width and Height
All visible objects have properties that determine the location and size. Left and Top property value is relative to the container ( eg an embedded textbox on the form, then the form is referred to as a container for the textbox ) ,
While the Width and Height define the size of the object .

b . Property Fore Color and Back Color
This property affects the text color and background color , but not all controls have let the Scroll - Bar and Command Button that does not have a property Fore Color and Back Color property only works if the style was changed to 1 - Graphical .

c . Font property
Fonts can be specified via a dialog box , but at runtime , it should be done with the property Name , Size , Bold , Italic , Underline , strikethrough , because it actually is a Font object mixture .

d . Caption and Text properties
Caption is the text that appears in a control ( or tittle in object form ) in which the user can not directly modify ( Control Label , CommandButton , CheckBox , OptionButton , Data and Frame ) , instead Text is the text that can be modified by the user ( TextBox control , ListBox and ComboBox ) .

e . Enabled and Visible properties
At default all controls and forms are Enabled and Visible . We can hide a control by using the Visible property = False .

f . Tabstop property and the TabIndex
A control that can receive the input focus has the tabstop property . Control has tabstop property also has a TabIndex property .
Tabstop property to determine whether a control can receive focus on Tab keystrokes by the user , the default is True , while TabIndex determine the order of focus when the user presses the Tab .

g . Property MousePointer and MouseIcon
This property will determine the shape of the cursor when the mouse is over the control .

Comments