|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Hi. I'm fairly new at VB.net and I'm trying to post a bunch of data from a class full of arrays to a bunch of labels on a form to print.
I know in VB6, I could just make a control array and I'd be happy, however since .NET doesn't support that, I'm trying to create a sub that will allow me to dynamically access any label on my form. I've set a standard naming scheme for my labels and would like to be able to do something like: Private Sub pieceload(ByRef form As PrintFrm, ByVal wk As String, ByVal label As String, ByVal counter As Integer) Dim formlabel 'formlabel is a generic label that i wish to dynamically reference an actual label on form formlabel.Name = wk & label & counter 'the new name for formlabel is an actual name of a label on the form Select Case wk Case "wk1" form.formlabel.text = Week1.GetVal(label, counter) 'here's the value of the label case (etc...) End Select End Sub This sub would then be called from within a for loop in another sub so that all items in the form can be populated. Any ideas on whether this is even possible? Any help is much appreciated |
![]() |
| Viewing: Dev Articles Community Forums > Programming > .NET Development > dynamic label accessing? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|