Results 1 to 5 of 5

Thread: Ignore &?

  1. #1
    Guest

    Question

    You know how when you use "&" in a label, it comes out like this - Label1 - Is there anyway to ignore &?

  2. #2
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431
    What is it that you want to do? If you want "&" as a part of the label then use two of them like My&&Label which will appear as My&Label. If you want to print a label like &Label1 without the L being underlined, then use this routine:
    Code:
    Public Function StripAmpersand(sCaption As String) As String
    
        Dim nPos As Integer
        
        Const AMPERSAND = "&"
        
        nPos = InStr(1, sCaption, AMPERSAND)
        
        StripAmpersand = Left(sCaption, nPos - 1) & Right(sCaption, Len(sCaption) - nPos)
    
    End Function

  3. #3
    Guest
    Ok, this is what I mean: When I use the Webbrowser control and make it so that when you drag over a link, it will show you what it is. If it has "&new" in it or whatever, it will underline n. I know how to find it, Instr(label2, "&"), but now, how do I replace it so that there will be two &'s put down?

  4. #4
    PowerPoster BruceG's Avatar
    Join Date
    May 2000
    Location
    New Jersey (USA)
    Posts
    2,657
    Try setting the label's UseMnemonic property to False.
    "It's cold gin time again ..."

    Check out my website here.

  5. #5
    Guest
    Originally posted by BruceG
    Try setting the label's UseMnemonic property to False.
    Thanks, that is just what I needed.

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