You are on page 1of 18

COLABORATIVE ACTIVITY

STEP 1 UNIT 1 IDENTIFY THE BASIC TOOLS FOR PROGRAMMING IN


VISUAL BASIC

COURSE: VISUAL BASIC (BASIC LEVEL)

BY:
HERNANDO JOS NAVARRO HERNNDEZ
Student code: 79878229

TUTOR:
Engineer. HERNANDO ARBEY ROBLES

GROUP: 201416_45

UNIVERSIDAD NACIONAL ABIERTA Y A DISTANCIA


UNAD
SEPTEMBER 2017
INTRODUCTION

There are three broad categories of controls in Visual Basic:

Intrinsic controls, such as the command button and frame controls. These controls
are contained inside the Visual Basic .exe file. Intrinsic controls are always included
in the toolbox, unlike ActiveX controls and insertable objects, which can be removed
from or added to the toolbox.

ActiveX controls, which exist as separate files with an .ocx file name extension. These
include controls that are available in all editions of Visual Basic (DataCombo,
DataList controls, and so on) and those that are available only in the Professional and
Enterprise editions (such as Listview, Toolbar, Animation, and Tabbed Dialog).
Many third-party ActiveX controls are also available.

Note Controls with the .vbx file name extension use older technology and are found
in applications written in earlier versions of Visual Basic. When Visual Basic opens
a project containing a .vbx control, the default behavior is to replace the .vbx control
with an .ocx control, but only if an .ocx version of the control is available. See
"Updating Older Versions of Visual Basic Controls" later in this chapter for
information on updating controls to the .ocx format.

Insertable Objects, such as a Microsoft Excel Worksheet object containing a list of


all your company's employees, or a Microsoft Project Calendar object containing the
scheduling information for a project. Since these can be added to the toolbox, they
can be considered controls. Some of these objects also support Automation (formerly
called OLE Automation), which allows you to program another application's objects
from within a Visual Basic application. See "Programming with Objects," for more
information on Automation.
VISUAL BASIC 2010 TOOLBOX

1. The pointer

The pointer is the only tool in the box that you cant use to draw a control instead you
can use the pointer to select a control when you want to change its properties and
definitions

2. Picture Box

The image tool is use to display a graph. Images can be decorative or functional as an
icon.

This control is extremely useful for graphing. The properties of this control are:
BackColor, BorderStyle, Enabled, Font, ForeColor, Height, Left, TabIndex, TabStop, Tag,
ToolTipText, Top, Visible, and Width.
AUTOREDRAW: redraws the graphical methods automatically. Align: this property aligns
the control in a part of the form that contains it: 0 = None, 1 = Up, 2 = Down, 3 = Left and
4 = Right.
AUTOSIZE: Determines whether the drawing box adapts its size to the size of the selected
image.
FONTTRANSPARENT: Sets whether the results of the graphic methods are displayed.
PICTURE: places an image in the drawing box. The methods of this control are, in addition
to the graphic methods, the following: Drag, Move, Refresh, ZOrder

3. Label

The label tool is used to draw a text box that you do not want an user to modify. Normally
you use the labels to create headers under the graphics or identify the contents of the text
boxes.

This component is used to display texts or static messages within the


forms, texts such as headers, application to the program user so that
provide some data or information (age, give me salary, etc.), in a way does
the functions of printf, cout, writeln, print, display, etc., but only when
consider in your message part.
It is also an object in Visual Basic and therefore has its own associated
properties and events, at the same time as it is being used inside the object
form1, many properties that are defined for the Form1 object, the Label1 object
will inherit.

While it is true that the object is called Label, but when placed inside a
Visual Basic is automatically numbered, if three Labels are placed in
Form1, they are called, symbolized, processed or programmed as Label1, Label2,
Label3.

It is your Caption property, which carries the content of the message you want to deploy
on the screen, just right click on one side of the Caption property on the
properties, having selected the Label1 box in the form and typing the text
indicated.

ALIGNMENT: aligns the text inside the control (left, right or centered).
AUTOSIZE: Sets the size of the label to the text it contains (True).
BACKCOLOR: sets the background color of the control.
BACKSTYLE: establishes whether the label will have a background or will be transparent.
BORDERSTYLE: Sets whether the label will be flat or bordered.
FONT: allows you to set the characteristics of the control source (except color).
FORECOLOR: sets the color of the font.
HEIGHT: Sets the width of the control.
LEFT: sets the distance from the left edge of your container.
TAG: saves additional data.
TOOLTIPTEXT: sets a text that is displayed by placing the mouse on the control.
TOP: Sets the distance between the control and the top edge of your container.
VISIBLE: makes the control visible or invisible.
WIDTH: sets the length of the control.
WORDWRAP: Sets whether there can be text in several lines in the label. The events that
this tool handles are:
CHANGE: is activated by changing the label text (Caption property)
CLICK: is activated when the mouse is clicked on the control.
DBLCLICK: is activated by double clicking on the control.
MOUSEDOWN: is activated by releasing a mouse button on the control.
MOUSEMOVE: is activated when the user moves the mouse over the control.
MOUSEUP: is activated by pressing a mouse button on the control. The methods that this
control supports are as follows:
DRAG: this method starts, cancels or terminates the drag methods.
MOVE: allows you to change the position and size of a control.
REFRESH forces to redraw a control.
ZORDER: allows to order the controls, that is, to place some in front or behind others

4. Text Box

The text box tool is use to draw a box containing convenient numeric and alphabetic
characters.

Text boxes are used to enter most of the data into applications. Text boxes allow you to
edit text (or numbers) directly. The most important property of text boxes is the Text
property, which represents the text contained in the control.
The properties of this control are Alignment, BackColor, BorderStyle, Font, ForeColor,
Height, Left, Tag, ToolTipText, Top, Visible, and Width.

APPEARANCE: sets whether the control is viewed with 3D or plane effect.


ENABLED: Determines whether a user can generate events on the control.
LOCKED: determines whether the text in the text box can be modified directly.
MAXLENGHT: Determines the maximum number of characters the text box can have.
MULTILINE: determines whether there can be multiline text in the text box.
PASSWORDCHAR: replaces the text written by a character, which does not allow the real
text (such as security keys) to be visible.
SCROLLBARS: Allows you to place scroll bars at the borders to parse in case the text is
too long.
TABINDEX: returns the tab order of a control (you can scroll through the controls by
pressing the TAB key).
TABSTOP: Sets whether this control receives focus (focus) through the key. The events of
this control are: Click, Change, DblClick, DragDrop, DragOver, MouseDown, MouseMove
MouseUp
GOTFOCUS, occurs when the control receives the focus (it becomes the active control).
KEYDOWN, active when you press a key on the keyboard while the control has the focus.
KEYPRESS, occurs when you press and release a key
KEYUP, occurs when releasing a key from the keyboard while the control has the focus.
LOSTFOCUS, applies when the control loses focus (it is no longer the active control).
VALIDATE occurs when a control loses focus in favor of a control that produces a
validation
5. Frame

You use the Frame tool to create a functional or graphical grouping for the controls.

The frames serve as containers for other controls, with a title in its upper part, the
Caption property that is the title that will appear the top of the control. Other important
properties are:

BORDERSTYLE: allows you to display the border of the control with its title, or no
Appearance, BackColor, Enabled, Font, ForeColor, Height, Left, TabIndex, Tag,
ToolTipText, Top, Visible and Width.
Events supported by frames are: Click, DblClick, DragDrop, DragOver, MouseDown,
MouseUp and MouseMove.
The methods of the frames are: Drag, Move, Refresh and Zorder

6. Command Button
You use the Command Button tool to create a visible object that the user can choose to
perform a task.

The function of the command buttons is to start actions and Windows is full of this type
of control, for example the Start button, the OK and Cancel buttons of the dialog boxes, etc.

The most usual is to use the Click event of this control to trigger different operations, by
virtue of what you want to accomplish. Nevertheless some properties are given:

CAPTION: name of the button. If you add the character & in front of a character, it will
appear underlined with which you can also trigger the evento clic with the Alt key pressed
and the underlined character. In the example of the image button, it would be Alt + u.
CANCEL : Determines whether the command button functions as the Cancel button on a
form.
PICTURE: sets the graphic to be displayed on the button when its Stylesea property equals
1.
STYLE: (0) or graphic conform (1). The properties DisabledPicture, DownPicture,
MaskColor and UseMaskColor have the same meaning as in the option buttons. The
methods are (Click, DblClick, KeyPress, etc.).

7. Check Box

It serves to create a selection box that the user can easily select to indicate if something
is true or false.

They perform a similar function to the buttons. As for their properties, methods and
events, they are similar to those of the option buttons (except that it does not have the
DblClick event). Its Value property presents a variant with respect to the Value property of
the buttons option: While in the radio buttons the Value property can take two values (True
or False), checkboxes can take three: Checked (1), Unchecked (0) or Grayed (2).

8. Option Button

You use the Option Button tool in a group to display multiple options from which the
user can choose only one.

These buttons allow one of a number of options to be selected, only one. For example, a
city may be selected, the others are excluded. The most important property is the Value
property, which indicates whether the button is active (True) or not (False). Other important
properties are: Appearance, BackColor, Enabled, Font , ForeColor, Left, TabIndex,
TabStop, Tag, ToolTipText, Tag, Top, Visible, and Width.

ALIGNMENT: to align the text left or right.


CAPTION: is the name of the button.
DISABLEDPICTURE: Returns the graphic that will be displayed when the button is
enabled (when the Style property is 1).
DOWNPICTURE: Returns the graphic when the button is pressed (Stylees 1 property).
MASKCOLOR: sets a color of the button image that will be shown transparently (Style
property is 1).
PICTURE: sets the image when its style property is 1.
STYLE: sets the style of the control, either the Windows standard (Style 0) or graphical
conform (Style 1).
USEMASKCOLOR: returns the color specified by the MaskColor property as shown in
transparent (when Style is 1).
VALUE: Controls are Drag, Move, Refresh, SetFocus and ZOder. The events that the
control supports are Click, DblClick, DragDrop, DragOver, GotFocus, KeyDown,
KeyPress, KeyUp, LostFocus, MouseDown, MouseMove, MouseUp and Validate

9. Combo Box

You use the combo box tool for a combination of list box and text box

Combined boxes combine the qualities of text boxes with list boxes, has the AddItem,
RemoveItem, Clear, ListCount, List, and ListIndex methods of list boxes. It also has the
Text property that indicates the current selected element (the element that has the index
indicated by ListIndex). An important property of this control is the Style property, which
has three values that specify the type of display that the Pooled Box control will have. It
also has the DropDown event, which occurs when the list portion of the control is being
deployed.
10. List Box

You use the list box tool to display a list of items from which the user can choose only
one.

With this control to perform different tasks, according to the needs of the program that
is being created. This control has several properties and methods that manipulate the data it
contains

Each line of the list box is an item in the list, and is identified with an index number;
the indexes begin to be numbered by zero (0).

The properties of this control are Appearance, Back Color, Enabled, Font, ForeColor,
Height, Left, TabIndex, TabStop, Tag, ToolTipText, Top, Visible, and Width.

COLUMNS: sets whether items are placed in a single column (when it is 0) or in more than
one journalistic style column (when it is worth more than 0).
LIST: allows you to enter elements at design time.
MULTISELECT: allows you to select more than one item.
SORTED: allows you to enter data sorted in alphabetical order or not.
STYLE: Shows the list with or without selection boxes (Standard or Checkbox). The events
of this control are Change, Click, DblClick, DragDrop, DragOver, GoFocus, KeyDown,
KeyPress, KeyUp, LostFocus, MouseDown, MouseMove, MouseUp and Validate.
ITEMCHECK (Item as Integer) - occurs when you enable or disable an item in the list
when the Style property is Checkbox. The Item argument represents the index.
SCROLL: occurs when you move the scroll bar of the control. The methods of this control
are Drag, Move, Refresh, SetFocus, and ZOrder.
ADDITEM: This method enters items in the list box. Its general form is as follows:
NLISTBOX.ADDITEM (Item As String, [Index]) NListBox is the name of the list box;
Item is a character string that will be the element, Index is an optional argument that
specifies the index number that will be.
REMOVAL: deletes items. Its general form is as follows: NListBox.RemoveItem (Index as
Integer) Where NListBox is the name of the list box; Index is the index of the delete
element.
CLEAR: removes all elements of the control. Its general form is: NListBox.Clear Where
NListBox is the name of the list box.
LISTCOUNT: counts the number of elements in the control. It is read only.
LIST (INDEX AS INTEGER): returns an item in the list, specified by the Index argument.
Note that the first item in the list will have index 0 and the last one a value equal to the
number of items minus 1 (ListCount-1).
LISTINDEX: returns or sets the item that is selected from the list, by its index number.
Keep in mind that the first item in the list will have index 0 and the last one a value equal to
the number of items minus 1 (ListCount-1).
SELCOUNT: is applied when the Style property has the Checkbox value and returns the
number of elements enabled

11. Image Box


This control allows you to view images inside them: bitmaps (* .bmp or * .dib), JPG
format (* .jpg), graphic exchange format (* .gif), and icons and cursors (* .ico and * .cur).
This control, without any image inside it is totally transparent and cannot receive the focus.
The properties of this control are as follows: Appearance, BorderStyle (similar to the
BorderStyle property of the tags), Enabled, Height, Left, Tag, ToolTipText, Top, Visible,
and Width.

PICTURE: is the image that will contain the control.


STRETCH: Determines whether the image contained in the image box conforms to the
size of the picture box. the methods of this control are: Drag, Move, Refresh and ZOrder.
The events that this control supports are the following: Click, DblClick, DragDrop,
DragOver, MouseDown, MouseMove and MouseUp.

12. Timer

This control does not have a graphical interface (you do not see anything on the form),
but its effects do. The function of this control is to repeat tasks every certain interval of time.
The image is of the icon that represents the control at design time, since in execution time it
is not seen. The most important properties of this control are:

ENABLED: Activates or deactivates the control (the Timer event).


INTERVAL: is the time in milliseconds with which the Timer event is repeated. If timer does
not take place the Timer event. This control has no methods and has a single event: the Timer
event, which occurs with the periodicity indicated by the Interval property as long as it is
greater than 0 and the Enabled property is True.

13. Dirlistbox

This is a list box with the directories present in a certain subdirectory directory. Double-
clicking on any of the directories will access the subdirectories of that directory. Each list
element is a directory. Because it is a list box, it has its List, ListCount, and ListIndex
properties, but not the methods for adding, removing, and deleting items.

14. Filelistbox
This control is a list box with the files contained in an subdirectory directory. As a list box
it has the List, ListCount, and ListIndex properties of this control, but not the methods for
adding, removing, and deleting items. The Path property, which is a character string with the
directory path that contains the files shown in the control. Another important property is the
property Pattern, a string of characters which sets the extensions of the files to be displayed
(default *. *); if given the value *.doc only doc extension files will be shown, if he value is
given *.txt, *.bmp will show files with extension txt and bmp, and so on. Other properties
are:

NORMAL: determines whether the control displays the files with the Normal attribute.
ARCHIVE: determines whether the control displays files with the modified attribute.
HIDDEN: determines whether the control shows the hidden files.
READONLY: Determines whether the control displays files with the ReadOnly attribute.
SYSTEM: determines whether the control displays the files with the System attribute. The
methods and events are the same as for the list boxes.

15. Scrollbars

There are two types of scroll bars: horizontal scroll bars and vertical scroll bars, both have
the same properties, methods, and events. The bars have a minimum value and a maximum
value. These extremes are represented by two properties: Min and Max, which specify the
minimum and maximum values respectively. The current value is determined by the Value
property, it is a value that changes when the cursor is changed and is between the minimum
and maximum (ie Min <= Value <= Max). The methods of this control are Drag, Move,
Refresh, SetFocus and ZOrder. The scroll bars have two events that will be the most
important of this control, they are:

CHANGE: This event occurs when the value of the bar has been changed and does not carry
any arguments.
SCROLL: occurs while moving the bar and does not have arguments. DragDrop, DragOver,
GotFocus, KeyDown, KeyPress, KeyUp, LostFocus and Validate.
Bibliografa

Ceballos, J. (2010). Visual Basic .NET: lenguaje y aplicaciones (3a. ed.), captulo 2.
Fundamentos de Visual Basic .Net, Recuperado de
http://bibliotecavirtual.unad.edu.co:2077/lib/unadsp/reader.action?ppg=38&docID=110389
34&tm=1480458925094

Fernndez, C. (2009). Visual Basic: bsico. Madrid, ES: RA-MA Editorial. Captulo 3,
lenguaje Basic. Recuperado de
http://bibliotecavirtual.unad.edu.co:2077/lib/unadsp/reader.action?ppg=38&docID=110466
05&tm=1480459848979

Rubiano. J. (2015). Material de apoyo unidad 1. Recuperado de


http://hdl.handle.net/10596/9390

Stephens, R. (2010). Visual Basic 2010: Programmer's Reference. Indianpolis, IN:


Wrox. Parte 1. Recuperado de
http://bibliotecavirtual.unad.edu.co:2051/login.aspx?direct=true&db=nlebk&AN=310355&
lang=es&site=ehost-live

You might also like