1. Home
  2. Computing & Technology
  3. Visual Basic

Chapter 3 - Working With ToolBox Controls

By Dan Mabbutt, About.com

2 of 6

Objects, Methods, Properties, and Events

Intellisense

Intellisense

One of the main goals of the Birthday Program (page 70) is to show you a more complex control that is so complete that it's like a subsystem you can drop right into your program. A control is one of the most important types of Object that is used in VB.NET and this is a great time to tie together where the main components of an Object can be found. Consider this simplified statement from the Birthday Program.

~~~~~~~~~~~~~~~~~~~~~~~~~
Private Sub Button1_Click( _
  ByVal sender As Object, _
  ByVal e As System.EventArgs) _
  Handles Button1.Click
  MsgBox(DateTimePicker1.Value.DayOfYear.ToString)
End Sub
~~~~~~~~~~~~~~~~~~~~~~~~~

The key items are:

  • Objects:
    DateTimePicker1 and Button1
  • Properties:
    Value and DayOfYear
  • A Method:
    ToString
  • An Event:
    Click
    (this is a Button event, however, not a DateTimePicker event)

Once you really get the concept of where these things can be found and how to use them, you've got most of the new object oriented VB.NET!

Let's consider these one at a time.

First, the objects. Objects can come from a number of places and it's a bit too early in this course to try to cover them all. These objects are called components and came from the Toolbox. Keep in mind that the Toolbox is just something that Visual Studio uses to organize components and make them easier to use.

Explore Visual Basic
By Category
About.com Special Features

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

Easy ways to connect two computers for networking purposes. More >

  1. Home
  2. Computing & Technology
  3. Visual Basic
  4. Learn VB.NET
  5. Working With ToolBox Controls

©2009 About.com, a part of The New York Times Company.

All rights reserved.