Exforsys

VB.NET 2005

  1. VB.NET 2005 Free Training
  2. The .NET Framework Architecture Part 1
  3. The .NET Framework Architecture Part 2
  4. Application Class and Message Class
  5. Implementing Class Library Object
  6. Visual Studio.NET Namespaces
  7. .NET Assemblies
  8. Differences between VB.NET 1.0 and VB.NET 2.0
  9. Introducing VB.NET Windows Forms
  10. Visual Studio Windows Forms Designer
  11. Exploring the Forms Designer generated code
  12. Setting and Adding Properties to Windows Form
  13. Implementing Inheritance
  14. Event Handling In Visual Basic .NET
  15. Building Graphical Interface elements
  16. .NET Common Windows Forms Controls Part 1
  17. .NET Common Windows Forms Controls Part 2
  18. Common Controls and Handling Control Events
  19. DomainUpDown and NumericUpDown Controls
  20. Dialog Boxes in Visual Basic .NET
  21. Visual Studio Adding Controls to Windows Form
  22. VB.NET Validation Controls
  23. Working with Menu Controls
  24. VB.NET MDI Applications
  25. .NET Exceptions
  26. VB.NET Creating and Managing Components Part 1
  27. VB.NET Creating and Managing Components Part 2
  28. Simple Data Binding
  29. .NET Complex Data Binding
  30. .NET Data Form Wizard
  31. Data Manipulation with ADO.NET
  32. SQL Server Stored Procedures
  33. SQL Server Ad Hoc Queries
  34. Finding and Sorting Data in DataSets
  35. ADO.NET Object Model
  36. Working with DataSets
  37. Using XML Data
  38. Working with File System in .NET
  39. Creating Web Service
  40. Instantiating - Invoking Web Services, Creating Proxy Classes with WSDL
  41. Web Reference and Web Services
  42. Web Services - SOAP, WSDL, Disco and UDDI
  43. Web Application Testing in VB.NET 2005
  44. Web Application Tracing and Debugging
  45. Working with Legacy Code and COM Components
  46. ActiveX Controls and Legacy Code
  47. Windows Application Testing
  48. VB.NET Windows Application Testing
  49. Tracing VB.NET Windows Application
  50. Debugging Windows Applications In Visual Studio.NET 2005
  51. Deploying Windows Applications In Visual Studio.NET 2005
  52. Customizing Setup Project in Visual Studio.NET 2005
  53. Shared Assembly
  54. Microsoft .NET Creating Installation Components
  55. The Registry Editor in Visual Studio.NET 2005
  56. The File Types Editor

Ads


Home arrow Technical Training arrow VB.NET 2005

.NET Common Windows Forms Controls Part 2 Page - 2

Page 2 of 3
Author : Exforsys Inc.     Published on: 2nd Jul 2005    |   Last Updated on: 24th Dec 2007

.NET Common Windows Forms Controls Part 2

.

.

Ads

TreeView

Tree Views are used to display a hierarchy of nodes. Each node can have several child nodes. A typical example of this is the Widows Explorer. In the Windows Explorer you can see the tree view of the directory of the drives. You can either expand all the levels or collapse the nodes just by clicking on them. When they are expanded, you can see all their children. You can also choose the icon that will be displayed for the node. If the CheckBoxes property is set to true, then you can see that the tree view shows a check box. Nodes and SelectedNode are the two main properties of this control. The Node property contains the list of nodes in the tree view. SelectedNode property gets or sets the currently selected node. The nodes collection for a node holds the node’s child TreeNode objects. You can add or remove or clone a TreeNode. Tree views also support other properties for navigating through them, node by node. The properties like FirstNode, lastNode, NextNode, PreNode, NextVisibleNode, PreVisibleNode are used for this purpose.

ListView

In contrast to the TreeView the ListView is used to list the items in the right side of the windows and it serves as complimentary to the TreeView. ListViews can display their items in four different methods viz., View.largeIcon, View.SmallIcon, View.list, and View.Details.

ListItems is the property of the Listview, that contains the items displayed by the control. The SelectedItems property contains a collection of the items currently selected in the control. If the multi-select property is set to true, then the user can select multiple item.

Timer

Timer Class is a component that is used to create periodic Tick events that to execute code at specific interval. Some of the properties, methods and events are given below:

Property/Method/Event

Description

Enabled

Gets/Sets whether the timer is running

Interval

Gets/Sets the time in milliseconds between timer ticks

Start

Starts the timer

Stop

Stops the timer

Tick

Occurs the timer interval has elapsed


 

 

 

 

 

 

The timer can be started or stopped using the method Start() and Stop(). The Tick event handler will be used to add codes that we need to manipulate the activity of the timer. Each tick event takes place at a default time of 100 milliseconds. This default value can be changed. The following demo illustrates the usage of the timer component.

To a new project in Visual Basic
Express add a timer component to the Form1.
Add two buttons.
Add the following code to the page:

Click here for Sample Code

The output generated by the program is shown below:

The startup screen is shown below:

When you press the Timer button, it calls the TimerStartStop method defined which starts the timer and throws a message box which you see below

Ads

When you click Ok in the MessageBox, it stops the timer. While the timer is running the Tick event handler is incrementing the value of the variable t by 100 for every tick, which is the default time it takes between two successive Tick events. The timer event is stopped and the value of t is assigned to t2 after dividing it by 1000 to convert to seconds. This value is now displayed using the last MessageBox.





 
This tutorial is part of a VB.NET 2005 tutorial series. Read it from the beginning and learn yourself.

VB.NET 2005

  1. VB.NET 2005 Free Training
  2. The .NET Framework Architecture Part 1
  3. The .NET Framework Architecture Part 2
  4. Application Class and Message Class
  5. Implementing Class Library Object
  6. Visual Studio.NET Namespaces
  7. .NET Assemblies
  8. Differences between VB.NET 1.0 and VB.NET 2.0
  9. Introducing VB.NET Windows Forms
  10. Visual Studio Windows Forms Designer
  11. Exploring the Forms Designer generated code
  12. Setting and Adding Properties to Windows Form
  13. Implementing Inheritance
  14. Event Handling In Visual Basic .NET
  15. Building Graphical Interface elements
  16. .NET Common Windows Forms Controls Part 1
  17. .NET Common Windows Forms Controls Part 2
  18. Common Controls and Handling Control Events
  19. DomainUpDown and NumericUpDown Controls
  20. Dialog Boxes in Visual Basic .NET
  21. Visual Studio Adding Controls to Windows Form
  22. VB.NET Validation Controls
  23. Working with Menu Controls
  24. VB.NET MDI Applications
  25. .NET Exceptions
  26. VB.NET Creating and Managing Components Part 1
  27. VB.NET Creating and Managing Components Part 2
  28. Simple Data Binding
  29. .NET Complex Data Binding
  30. .NET Data Form Wizard
  31. Data Manipulation with ADO.NET
  32. SQL Server Stored Procedures
  33. SQL Server Ad Hoc Queries
  34. Finding and Sorting Data in DataSets
  35. ADO.NET Object Model
  36. Working with DataSets
  37. Using XML Data
  38. Working with File System in .NET
  39. Creating Web Service
  40. Instantiating - Invoking Web Services, Creating Proxy Classes with WSDL
  41. Web Reference and Web Services
  42. Web Services - SOAP, WSDL, Disco and UDDI
  43. Web Application Testing in VB.NET 2005
  44. Web Application Tracing and Debugging
  45. Working with Legacy Code and COM Components
  46. ActiveX Controls and Legacy Code
  47. Windows Application Testing
  48. VB.NET Windows Application Testing
  49. Tracing VB.NET Windows Application
  50. Debugging Windows Applications In Visual Studio.NET 2005
  51. Deploying Windows Applications In Visual Studio.NET 2005
  52. Customizing Setup Project in Visual Studio.NET 2005
  53. Shared Assembly
  54. Microsoft .NET Creating Installation Components
  55. The Registry Editor in Visual Studio.NET 2005
  56. The File Types Editor
 

Comments