You are on page 1of 11

Common Controls

Toolbox in Visual Basic.net 2008 consist of Controls, Containers, Menu Options, Crystal Report
Controls, Data Controls, Dialogs, Components, Printing controls, that are used in a form to design
the interfaces of an application.
Following table lists the Common Controls listed in the ToolBox.

Pointer
Button
Check Box
CheckedList Box

Combo Box

DateTimePicker
Label
LinkLabel
List Box
List View
Masked Text Box
MonthCalendar
Notify Icon

NumericUpDown

Picture Box
Progress Bar
Radio Button
Rich TextBox

range.
Display image files
Display the progress of a task.
Allows to choose a choice from a group of choices.
Allows to edit, input rich text.

Text Box

Control used to input or display text.

ToolTip

Displays tooltip text.

Used to move and resize controls and forms.


This Control triggers an action when accessed.
Control that has values either true or false
Lists check box next to each item
A combination of list and text box controls that enables to select as
well as edit text.
Display a calender picker to choose the day and date.
Displays a label text.
Displays a label with a link text.
Control that lists number of items.
Extension of ListBox control with options to add icons,headings.
Uses a Mask to differetiate proper and improper text input.
Enable to select date at runtime
Displays an icon in the Windows Tray
Allows to input a integer of specific decimal places within a specific

Displays the hierarchy of nodes.


TreeView
Allows to open an html document in form.
WebBrowser
Thus you can use the toolbox in an effective way

Containers

Pointer

FlowLayoutPanel

GroupBox

It is used to select any control on the form. It is also used to


deselect any selected control.
The FlowLayoutPanel control displays the controls it contains in
rows or columns. For example, when laying out rows, it places
controls next to each other horizontally in a row until it runs out of
room and then it starts a new row.
The GroupBox control is good for grouping related controls or
the RadioButton controls in a RadioButton group. This control

provides a visible border and caption which can help the user
when works with a complicated form containing lot of controls.
In other words, it makes the interface much easier for the user
to understand.
The Panel control just like a GroupBox, can also contain the
RadioButton controls in a RadioButton group, but unlike a
GroupBox control, the Panel control doesn't display a visible
border, so you must use some other method to ensure that the
user can tell that the buttons are forming a group.
For example, you could use several Panels in a row, each

Panel

containing a column of RadioButton controls. Then the user would


select one option from each column.
One of the most powerful features of Panel control is its ability
to automatically display scrollbars. If you set a Panel
control's AutoScroll property to True and the Panel's content
cannot fit, it automatically displays the scrollbar so the user can
still see the whole content.
The SplitContainer control allows the user to divide an area
between two adjacent regions (two Panel controls in which you
can place your own controls).

SplitContainer

When the user drags the splitter between the two panels, the
control resizes the panels accordingly. In addition, if you set
the AutoScroll property of the panels to True, they will
automatically provide scrollbars when necessary.
The TabControl displays data grouped by pages, while
the tabs enable the user to quickly jump from page to page.

TabControl

Meaning, each page is a control container, holding whatever


controls you want for that tab. When you click a tab at design time
or the user clicks one at runtime, the control displays
the corresponding page.
The TableLayoutPanel control displays its contents in a grid. All

TableLayoutPanel

the cells in a particular row have the same height, and all the
cells in a particular column have the same width.

Menus & Toolbars

Pointer

ContextMenuStrip

It is used to select any control on the form. It is also used to


deselect any selected control.
This component represents a context menu and when you select it
on the form at design time, your IDE displays the menu at the top
of the form.
This control represents a form's menus, submenus, and menu

MenuStrip

items, and to make it working you have to set the Form's Menu
property to the MenuStrip control.
This control displays a series of buttons, dropdowns, and other
tools.

ToolStrip

You can access these tools quickly without navigating through a


series of menus, so they are most useful for performing frequently
needed tasks.
This control contains a ToolStripPanel along each of
its edges where a ToolStrip control can dock.
Its center is filled with another ToolStripPanel that can contain
other controls that are not part of the tool strips.

ToolSTripContainer

You can drag the ToolStrips around and position them inside of
any of the ToolStripPanel controls as much as you can move the
toolbars in the Visual Basic development environment.
Then you can drag the ToolStrips into multiple rows or
columns within the panels.

Data

Pointer

It is used to select any control on the form. It is also used to

Chart

deselect any selected control.


The Chart controls enable you to create ASP.NET pages or Windows
Forms applications with simple, intuitive, and visually compelling

BindingNavigator

charts for complex statistical or financial analysis.


BindingNavigator is used to navigate between data records.
BindingNavigator provides buttons to the user to add, save, delete,
go forward, go backword, etc.

DataGridView

This control displays a table-like grid display while the data can
come from a data source such as a DataSet or BindingSource.
The DataGridView provides many properties for customizing

DataSet

appearance of the grid.


The DataSet is a complex and very powerful object that is actually
an equivalent to "in-memory representation" of a database.

Components

Pointer

It is used to select any control on the form. It is also used to


deselect any selected control.
Visual Basic .net BackgroundWorker performs a task in the
background, without affecting the form that executed the

BackgroundWorke

command. Sometimes it is useful to use this control when

downloading a file, or copying a paste a file if the file is too large


and takes a lot of time. After the task is done, BackgroundWorker
send the result back to the form.
This component is a node or object in the Active Directory hierarchy

DirectoryEntry

DirectorySearcher

(a service that provides a common, hierarchical view of distributed


resources and services on a network).
This object is performing queries against an Active Directory
Domain Services hierarchy.
This component indicates to the user that another control has an
error associated with it. Basicaly, the ErrorProvider is an extender
provider, as it adds a new Error property to the other controls on
its form. For example, if the ErrorProvider is named MyErrorProvider,
each control on the form gets a new property named "Error on

ErrorProvider

MyErrorProvider." (you can use the Properties window to set or


clear this value).
The ErrorProvider automatically displays a red circle containing an
exclamation mark next to the control, and if the user hovers the
mouse over the circle, the ErrorProvider displays a tooltip giving

EventLog

the error text.


This component enables an application to manipulate event logs,
providing methods to create logs, write and read log messages,
and clear logs.

In other words, it provides interaction with Windows event logs.


The FileSystemWatcher class lets an application watch for
changes to a file or directory and raises events (if
EnableRaisingEvents is True) to let your program know if something
changes. For example, it will notify your program if a file is created
in a certain directory.

FileSystemWatche
r

Its Filter property determines the files for which the watcher
reports events, but please be aware that you cannot watch
for multiple file types. Rather you have to use multiple
FileSystemWatcher instances. However the default Filter value
is *.*, which means it will watch all the files.
Its IncludeSubdirectories property determines whether the object
watches subdirectories within the main path (Path property
which determines the path to watch).
The HelpProvider displays help for the controls, and can
be associated with a control. Then, if the user sets focus to the
control and presses the F1 key, the HelpProvider is going
to display help for the control. It can display either a

HelpProvider

small tooltip containing a help string, or will open a help file.


To assign a help string to a control at design time, you should
use the Properties window ("HelpString on

ImageList

MessageQueue

HelpProvider1" property)
This component stores a list of images to be used by other controls
or by the code.
This component provides access to a queue on a Message
Queuing server.
Basicaly it allows you to connect to existing
queues, send and receive messages, and otherwise add
communication services to your application using a very small
amount of code.
As for beginning you add an instance of the MessageQueue
component to your project and configure it to interact with a
queue on your Message Queuing server.

As mentioned, you can add an instance of the MessageQueue


component to your Windows Forms application, but be aware that
MessageQueue components have no visual user interface.
This component represents a Windows NT performance counter

PerformanceCount

component, and can be used for both reading existing predefined or

er

custom counters and publishing (writing) performance data to


custom counters.
This component provides access to the processes that run on the
computer, and you can use this object to start, stop, and
monitor processes.

Process

You can also use the object to get information about a running
process such as its threads, the modules it has loaded, and
the amount of memory it is using.
When you add a new Process instance to the form, you set values
in its StartInfo property to define the application to run.
This component represents one of the computer's physical serial
ports, and provides properties and methods
for reading and configuring the port's baud rate, break signal,

SerialPort

Data Set Ready (DSR) state, port name, parity, and stop bits.
The class has methods for writing data to the port and

ServiceController

for reading synchronously or asynchronously.


This component represents a Windows service process, and
provides methods that let you connect to a running or stopped
service to control it or get information about it.
The ServiceController component's ServiceName property gets
or sets the name of the service associated with the component.
To set this value at design time, select a ServiceController in
the form designer. Then, click the ServiceName property in the
Properties window and click the dropdown arrow on the right to see
a list of available services on the system.
The class's methods let you start, pause, continue, or stop the

service.
We can use Timer Control in many situations in our development
environment. If you want to run some code after a certain interval
of time continuously, you can use the Timer control. As well as to
start a process at a fixed time schedule, to increase or decrease the

Timer

speed in an animation graphics with time schedule etc. you can use
the Timer Control. The Visual Studio toolbox has a Timer Control
that allowing you to drag and drop the timer controls directly onto a
Windows Forms designer. At runtime it does not have a visual
representation and works as a component in the background.

Printing

Pointer

It is used to select any control on the form. It is also used to


deselect any selected control.
Visual Basic offers a wide range of dialog boxes that allow the
user to make standard selections and each of them has a very
specific purpose.
The purpose of the PageSetupDialog is specifying page set up
for printing.

PageSetupDialog

It displays a dialog box that lets the user


specify properties for printed pages. For example, the user can
specify the printer's paper tray, page size, margins, and
orientation (portrait or landscape).
To display that dialog, this component calls its ShowDialog
method, which returns DialogResult.OK if the user clicks OK,

PrintDialog

and DialogResult.Cancel if the user cancels.


Visual Basic offers a wide range of dialog boxes that allow the
user to make standard selections and each of them has a very
specific purpose.
The purpose of the PrintDialog is printing a document.
This component displays a dialog box that lets the
user prepare to print. The dialog lets the user select a printer,
modify printer properties, select the pages to print, and
determine the number of copies to print.

To display the dialog you call its ShowDialog method.


This component represents an object that will be printed, and you
use this object to send output to the printer.
When you use this object to print something, you create the
object, set its properties (the printer's name, paper tray, etc.),

PrintDocument

and then call its Print method.


When PrintDocument needs to generate a page of output, it
raises its PrintPage event. Your code catches that
event, draws the page, and then sets the event
handler's e.HasMorePages value to indicate whether that was
the last page of output.
Visual Basic offers a wide range of dialog boxes that allow the
user to make standard selections and each of them has a very
specific purpose.
The purpose of the PrintPreviewControl is displaying a print
preview.

PrintPreviewContro
l

This control (the word Control helps you to differentiate it from the
PrintPreviewDialog control) displays a print preview, but usually,
it is easier to use the PrintPreviewDialog control described in the
next lesson to display a print preview dialog box.
The PrintPreviewControl control uses PrintDocument control to
generate the page(s) it needs and it displays them.
This component displays a dialog box that shows how the print
document will look like when it is printed.
Its most important property is Document, which determines
the PrintDocument object that the dialog box previews.

PrintPreviewDialog
The component's most important methods are Show, which
displays the dialog box Modelessly, and ShowDialog, which
displays the dialog box modally.
This component is remarkably simple to use. Set its Document
property and catch the PrintDocument object's PrintPage event.

Dialogs

Pointer

It is used to select any control on the form. It is also used to


deselect any selected control.
Visual Basic offers a wide range of dialog boxes that allow the
user to make standard selections and each of them has a very
specific purpose.
The purpose of the ColorDialog is selecting a color.

ColorDialog

This component displays a dialog that enables the user to select a


color from a standard palette or from a custom color palette.
First you call its ShowDialog method to display a color selection
dialog and then check if ShowDialog returns OK or Cancel if the
user cancels.
Visual Basic offers a wide range of dialog boxes that allow the

FolderBrowserDial
og

user to make standard selections and each of them has a very


specific purpose.
The purpose of the FolderBrowserDialog is selecting a folder
(directory).
Visual Basic offers a wide range of dialog boxes that allow the
user to make standard selections and each of them has a very
specific purpose.
The purpose of the FontDialog is selecting a font letting the user

FontDialog

specify a font's characteristics like a name, size, boldness, and


so on.
This component displays a font selection dialog, and has several
properties that determine the options that the dialog displays and

OpenFileDialog

the types of fonts it will allow the user to select.


Visual Basic offers a wide range of dialog boxes that allow the
user to make standard selections and each of them has a very
specific purpose.
The purpose of the OpenFileDialog is selecting a file to open.
To display a file selection dialog, this component calls
its ShowDialog method, which returns DialogResult.OK if the

user selects a file and clicks OK, and DialogResult.Cancel if the


user cancels.
This component provides a lot of properties for determining what
kind of files the user can select.
Visual Basic offers a wide range of dialog boxes that allow the

SaveFileDialog

user to make standard selections and each of them has a very


specific purpose.
The purpose of the SaveFileDialog is selecting a file for saving.

WPF Interoperability

Pointer

It is used to select any control on the form. It is also used to


deselect any selected control.
The ElementHost class allows you to host a Windows Presentation
Foundation (WPF) control in Windows Forms. When you host the

ElementHost

control, you can receive events and access the control's exposed
properties. The simplest way to host a WPF control is to add
a Panel control to your form, and then host the WPF control in
the Panel. You typically do this in your form's Load event handler.

Reporting

Pointer

ReportViewer

It is used to select any control on the form. It is also used to


deselect any selected control.
To view reports that have been deployed to a report server or
reports that exist on the local file system, you can use the
WinForms ReportViewer control to render them in a Windows
application.

VisualBasic PowerPacks

Pointer

PrintForm

It is used to select any control on the form. It is also used to


deselect any selected control.
The PrintForm component enables you to quickly print an image of
a form exactly as it appears on screen without using
a PrintDocument component. The following procedures show how to
print a form to a printer, to a print preview window, and to an

LineShape

OvalShape

RectangleShape

DataRepeater

Encapsulated PostScript file.


Represents a control displayed as a horizontal, vertical, or diagonal
line.
Represents a control displayed as a circle or oval.
Represents a control displayed as a square, rectangle, rounded
square, or rounded rectangle.
Displays data in a customizable list format.

You might also like