VB.Net Array Objects

Discussion in 'OT Technology' started by Fase, Dec 15, 2006.

  1. Fase

    Fase Your Face, In A Pickle Jar.

    Joined:
    Apr 6, 2004
    Messages:
    29,540
    Likes Received:
    0
    Location:
    Windsor, Ont, Canada.
    So I have the code to create and array a list of object I've created like such...

    Public Class Form1

    Public KeyTimerList As New Collection

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
    AddTimer()
    End Sub

    Private Function AddTimer() As System.Windows.Forms.Timer
    Dim KeyTimer As New Timer
    KeyTimer.Enabled = False
    KeyTimer.Interval = 100
    Me.components.Add(KeyTimer)
    KeyTimerList.Add(KeyTimer)
    Return KeyTimer
    End Function

    End Class


    My Question: Even if I used labels instead of timers, how do I add handles to them? Like if I create a bunch of timers or labels from cratch how do code like onclick for them? I'm used to VB6 and new to .Net, and I can't figure out how.

    Thanks.
     

Share This Page