|
-
May 28th, 2003, 08:07 PM
#1
Thread Starter
New Member
Using string variable to determine form and labels to be loaded
I have several forms.
Which form is used is determined by a selection that is made.
This I can do with a CASE statement, but I would like to know if there is a way to do this using a string value as indicated below.
EG.
sFrm = "Diary"
sLab = "Meeting"
sVal = "2PM"
how can I build the following code dynamically
frmDiary.lblMeeting.Caption = sVal
I have 15 forms and 50 labels per form which I wish to populate in this manner. Not all labels will be populated.
Thanks
-
May 28th, 2003, 10:41 PM
#2
PowerPoster
I am not sure I fully understand your post. Could you maybe give more details, maybe post some code of what you have (the case statement) etc...
Also, are you creating a Windows Form application or a Web Application? I am kind of confused by that also... it seems you are talking about a Windows Forms app, but you posted in the ASP.net forum...
-
May 29th, 2003, 03:05 PM
#3
Thread Starter
New Member
Hi
I am not sure how I got the post in the asp.net forum.
I am working on a windows form.
I will re-post in the correct forum.
an example of the case statement code
if sStyle = "One" then
Select Case UCase(sServ)
Case "WW"
frmWW.lblStyleOne.Caption = iCount
Case "WS"
frmWS.lblStyleOne.Caption = iCount
Case "SW"
frmSW.lblStyleOne.Caption = iCount
End Select
End If
if sStyle = "Two" then
Select Case UCase(sServ)
Case "WW"
frmWW.lblStyleTwo.Caption = iCount
Case "WS"
frmWS.lblStyleTwo.Caption = iCount
Case "SW"
frmSW.lblStyleTwo.Caption = iCount
End Select
End If
Many Thanks
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|