Results 1 to 3 of 3

Thread: Dynamic Control Collection - unable to get/set control properties

Threaded View

  1. #3
    PowerPoster Zvoni's Avatar
    Join Date
    Sep 2012
    Location
    To the moon and then left
    Posts
    5,263

    Re: Dynamic Control Collection - unable to get/set control properties

    You're passing the name of your label instead of the label itself in your click-event. When you Click on your label you have to first Set the reference to the clicked label.

    EDIT: For some reason this line is bugging me.

    Code:
    Private Sub Labels_Click(ByVal ControlName As String, ByVal Index As Integer)
        Labels(Index).Label.Caption = "FAIL"
    End Sub
    Shouldn't that be:
    Code:
    Private Sub Labels_Click(ByVal ControlName As String, ByVal Index As Integer)
        Labels.Item(Index).Caption = "FAIL"
    End Sub
    Last edited by Zvoni; Oct 29th, 2012 at 03:33 AM.
    Last edited by Zvoni; Tomorrow at 31:69 PM.
    ----------------------------------------------------------------------------------------

    One System to rule them all, One Code to find them,
    One IDE to bring them all, and to the Framework bind them,
    in the Land of Redmond, where the Windows lie
    ---------------------------------------------------------------------------------
    People call me crazy because i'm jumping out of perfectly fine airplanes.
    ---------------------------------------------------------------------------------
    Code is like a joke: If you have to explain it, it's bad

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