Using Variables inplace of Textbox Title

Im working on a piece of code where there are over 300 text box's, now most of these are not visible until a certain requirement is met, is there a way to setup so i can use a variable name instead of the textbox's name to set the visible.  Eg:

Private Sub DefendChanceLabel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DefendChanceLabel.Click
        DefendChance.Visible = True
        Count = +1
    End Sub

/\ that is how i have todo it atm, for each one(plus i have to add checks to see if their visible etc - so another 5 lines of code per item)

This is how i was trying to get it to work

   Private Sub ArtifactRarityLabel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ArtifactRarityLabel.Click
        LabelValue = "ArtifactRarity" <-- this is the variable im talking about
        Count = +1
    End Sub


    Private Sub BoxShow()
        LabelValue.Visible = True <- this of course isnt working - and thats what im trying to achieve, any ideas?
        Count = +1

    End Sub

Reply
Replies:
Comfortably Anonymous
5/9/2006 7:18:32 PM
This site contains copyrighted material the use of which has not always been specifically authorized by the copyright owner. We are making such material available in our efforts to advance understanding of environmental, political, human rights, economic, democracy, scientific, and social justice issues, etc. We believe this constitutes a 'fair use' of any such copyrighted material as provided for in section 107 of the US Copyright Law. In accordance with Title 17 U.S.C. Section 107, the material on this site is distributed without profit to those who have expressed a prior interest in receiving the included information for research and educational purposes. For more information go to: http://www.law.cornell.edu/uscode/17/107.shtml . If you wish to use copyrighted material from this site for purposes of your own that go beyond 'fair use', you must obtain permission from the copyright owner.