Results 1 to 15 of 15

Thread: [RESOLVED] Cutting off part of a label caption for a multiple choice question game.

Threaded View

  1. #3
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,541

    Re: Cutting off part of a label caption for a multiple choice question game.

    You can use Split()
    Code:
    Dim sQuestions() As String
    Dim intPos As Integer
    Dim strQ As String
    
        intPos = InStr(PickLBL.Caption, "?")     ' Locate the position of the "?" in PickLBL.Caption
        strQ = Mid$(PickLBL.Caption, 1, intPos - 1)  
    
        intPos = InStrRev(strQ,"*")
        RightANS.Caption = Mid$(strQ, intPos+1)
    
        sQuestions() = Split(Trim$(Left$(strQ, intPos-1)), ",")
    
    ' now you can loop 0 to 3 to get the 4 individual questions and display them individually how you'd like
    Edited: Misread your original description. The answer is not preceded with a comma, so the above would need to be tweaked... updated
    Last edited by LaVolpe; Oct 9th, 2017 at 12:33 PM.
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

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