Ampersand character showing up as _

6 posts, 0 answers
  1. Dan Harvey
    Dan Harvey avatar
    67 posts
    Member since:
    Jul 2008

    Posted 01 Feb 2010 Link to this post

    I am setting the text on a label based upon what a user types into a textbox.  Is the user types in the phrase "Dan & Co." the label will display "Dan _Co.".  How do I escape this character??

    Thanks,
  2. Dan Harvey
    Dan Harvey avatar
    67 posts
    Member since:
    Jul 2008

    Posted 04 Feb 2010 Link to this post

    This was solved, string.replace("&","&&")
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Nikolay
    Admin
    Nikolay avatar
    1803 posts

    Posted 04 Feb 2010 Link to this post

    Hi dan harvey,

    Indeed, this is one of the options that you have.

    When the UseMnemonic property is true, you need to use a second '&' if you want to display '&' instead of '_'. However, in case you do not want to place a second '&', you can just set the UseMnemonic property to false and your single '&' will be displayed as '&'.

    Best wishes,
    Nikolay
    the Telerik team

    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
    Follow the status of features or bugs in PITS and vote for them to affect their priority.
  5. Stack
    Stack avatar
    2 posts
    Member since:
    May 2016

    Posted 08 May in reply to Nikolay Link to this post

    I got the same problm with RadPanel and i didnt found UseMnemonic property, Any alternative?
  6. Stack
    Stack avatar
    2 posts
    Member since:
    May 2016

    Posted 08 May in reply to Stack Link to this post

    Resolved by UseMnemonic property in TextPrimitive, Thanks!
  7. Hristo Merdjanov
    Admin
    Hristo Merdjanov avatar
    712 posts

    Posted 09 May Link to this post

    Hi Stack,

    Thank you for writing.

    I am glad that you have resolved the issue.

    Please let me know if you need further assistance.

    Regards,
    Hristo Merdjanov
    Telerik
    Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
Back to Top
UI for WinForms is Visual Studio 2017 Ready