.NET Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgramming.NET Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old February 1st, 2005, 04:11 PM
drew1373 drew1373 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Feb 2005
Location: Erie, PA
Posts: 1 drew1373 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 25 m 56 sec
Reputation Power: 0
Send a message via AIM to drew1373
Question dynamic label accessing?

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

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgramming.NET Development > dynamic label accessing?


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway
Stay green...Green IT