Results 1 to 3 of 3

Thread: Control Arrays.

  1. #1

    Thread Starter
    PowerPoster sunburnt's Avatar
    Join Date
    Feb 2001
    Location
    Boulder, Colorado
    Posts
    1,403

    Control Arrays.

    Hiho. I was reading in the .NET help file about the elimination of Control Arrays. Not a bad way to do it, but with the new system, I can't figure out how to do something I found easy in vb6:
    Dynamically load and deal with controls. For example, in VB6:
    VB Code:
    1. Private Sub sckData_DataArrival(Index as Integer, bytesTotal as Long)
    2.  
    3. sckData(Index).Foo()
    4.  
    5. End Sub

    Then unlimited connections could be handled. However, in VB.NET, I would need to do something like this:

    VB Code:
    1. Private Sub sckData_DataArrival(ByVal sender As Object, ByVal e As AxMSWinsockLib.DMSWinsockControlEvents_DataArrivalEvent) Handles sckData1.DataArrival, sckData2.DataArrival, sckData3.DataArrival '.....
    2.  
    3.     sender.Foo()
    4.     End Sub

    If I don't know how many controls I will have at runtime, how am I to handle their events?
    Every passing hour brings the Solar System forty-three thousand miles closer to Globular Cluster M13 in Hercules -- and still there are some misfits who insist that there is no such thing as progress.

  2. #2

    Thread Starter
    PowerPoster sunburnt's Avatar
    Join Date
    Feb 2001
    Location
    Boulder, Colorado
    Posts
    1,403
    Resolved :-)
    VB Code:
    1. AddHandler NewSocket.DataArrival, AddressOf sckMain_DataArrival
    Every passing hour brings the Solar System forty-three thousand miles closer to Globular Cluster M13 in Hercules -- and still there are some misfits who insist that there is no such thing as progress.

  3. #3
    Frenzied Member Shawn N's Avatar
    Join Date
    Dec 2001
    Location
    Houston
    Posts
    1,631
    I was wondering how to do this, too. Thanks.
    Please rate my post.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width