Results 1 to 3 of 3

Thread: Using string variable to determine form and labels to be loaded

  1. #1

    Thread Starter
    New Member
    Join Date
    May 2003
    Posts
    3

    Post 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

  2. #2
    PowerPoster hellswraith's Avatar
    Join Date
    Jul 2002
    Location
    Washington St.
    Posts
    2,464
    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...

  3. #3

    Thread Starter
    New Member
    Join Date
    May 2003
    Posts
    3

    Post

    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
  •  



Click Here to Expand Forum to Full Width