Technical Training
VB.NET 2005Table of Contents
.NET Common Windows Forms Controls Part 2
.NET Common Windows Forms Controls Part 2 - Page 2
.NET Common Windows Forms Controls Part 2 - Page 3.NET Common Windows Forms Controls Part 2
.NET Common Windows Form Controls part 2
In this tutorial we will learn about Common Windows Forms Controls in Visual Basic .NET 2005. In this part 2 of this article, We will be learning the controls like Control MonthCalendar and DateTimePicker, TreeView and ListView, Timer, TrackBar and ProgressBar, HScrollBar and VScrollBar,
MonthCalendar
MonthCalendar is a very useful tool that has been added to the .NET Framework. Let us see how this works with an example. In a new project add a textbox and a command box to the form and also date time picker. In the code window add the following code:
The first screenshot shows the screen with the date time picker.

This screenshot shows the selected value in the textbox and the date time picker is hidden.

DateTimepicker
This control allows the user to select dates and times. Some of the important property of this class is given as below:
|
Property/evnets |
Description |
|
MaxDateTime |
Sets the maximum date value of the date time picker control |
|
MinDateTime |
Sets the minimum date value of the date time picker control |
|
Format |
Gets/Sets the format of the date and time |
|
MaxDate |
Gets/Sets the maximum selectable date and time |
|
MinDate |
Gets/Sets the minimum selectable date and time |
|
Value |
Gets/Sets the date and time value |
|
Closeup |
When the drop-down calendar disappears |
|
DropDown |
When the drop down calendar appears |
|
FormatChanged |
When the format property value changes |
|
ValueChanged |
When the value property changes |
The Windows Form’s DateTimePicker control allows the user to select a single item from a list of dates or times. When used to represent a date, it appears in two parts: a drop-down list with a date represented in text, and a grid that appears when you click on the down-arrow next to the list. The grid looks like the MonthCalendar control, which can be used for selecting multiple dates.
An alternative to the grid, useful for editing times instead of dates, is the up and down buttons that appear when the ShowUpDown property is set to true. When the ShowCheckBox property is set to true, a check box is displayed next to the selected date in the control. When the check box is checked, the selected date-time value can be updated. When the check box is empty, the value appears unavailable.
The following example explains the use of the DateTimePicker and the DateTimePicker1.ValueChanged event.
-
To a new project add to the Form1 a DateTimPicker control from the toolbox.
-
Double click on the control to open the editor for the DateTimePicker1.ValueChanged event.
-
Add the codes given below:
The output shows the various values that are extracted from the DateTimePicker. The following four screenshots show the sequence of events in executing the program.

The values are shown as the caption.



VB.NET 2005
- VB.NET 2005 Free Training
- The .NET Framework Architecture Part 1
- The .NET Framework Architecture Part 2
- Application Class and Message Class
- Implementing Class Library Object
- Visual Studio.NET Namespaces
- .NET Assemblies
- Differences between VB.NET 1.0 and VB.NET 2.0
- Introducing VB.NET Windows Forms
- Visual Studio Windows Forms Designer
- Exploring the Forms Designer generated code
- Setting and Adding Properties to Windows Form
- Implementing Inheritance
- Event Handling In Visual Basic .NET
- Building Graphical Interface elements
- .NET Common Windows Forms Controls Part 1
- .NET Common Windows Forms Controls Part 2
- Common Controls and Handling Control Events
- DomainUpDown and NumericUpDown Controls
- Dialog Boxes in Visual Basic .NET
- Visual Studio Adding Controls to Windows Form
- VB.NET Validation Controls
- Working with Menu Controls
- VB.NET MDI Applications
- .NET Exceptions
- VB.NET Creating and Managing Components Part 1
- VB.NET Creating and Managing Components Part 2
- Simple Data Binding
- .NET Complex Data Binding
- .NET Data Form Wizard
- Data Manipulation with ADO.NET
- SQL Server Stored Procedures
- SQL Server Ad Hoc Queries
- Finding and Sorting Data in DataSets
- ADO.NET Object Model
- Working with DataSets
- Using XML Data
- Working with File System in .NET
- Creating Web Service
- Instantiating - Invoking Web Services, Creating Proxy Classes with WSDL
- Web Reference and Web Services
- Web Services - SOAP, WSDL, Disco and UDDI
- Web Application Testing in VB.NET 2005
- Web Application Tracing and Debugging
- Working with Legacy Code and COM Components
- ActiveX Controls and Legacy Code
- Windows Application Testing
- VB.NET Windows Application Testing
- Tracing VB.NET Windows Application
- Debugging Windows Applications In Visual Studio.NET 2005
- Deploying Windows Applications In Visual Studio.NET 2005
- Customizing Setup Project in Visual Studio.NET 2005
- Shared Assembly
- Microsoft .NET Creating Installation Components
- The Registry Editor in Visual Studio.NET 2005
- The File Types Editor







