locked
Is it okay add html tag in rc file?

    Question

  • I load text from .rc files. Lets say for instance, I have this "MSFT forums"; i'd want to only bold out "MSFT"?

    So, I write my string as this "<b>MSFT</b> forums" -- Its not applying the style..Can anyone please help me with this?

    thanks!

    Thursday, May 07, 2015 9:33 AM

Answers

  • Are you writing a Windows Store app or a desktop app?

    Windows Store apps in .Net languages use resx files not .rc files.

    Typically you don't want to include formatting in your localizable resources but would add that when the resource is used.

    To diagnose why the style isn't applied you'll need to determine at what point the problem occurs. Look at how you are loading the resource and make sure it is correct once it's loaded into memory. Likewise check that it's still correct when you load it into whichever control you're displaying it in.

    The details will depend on the type of app and which functions you're calling to load, display, etc. the resource.

    Saturday, May 09, 2015 1:41 AM
    Owner

All replies

  • It depends on how you're displaying the content that comes from RC file.  If you were putting it inside a WebView, then the content would be bolded.  However, if it's going into some other control, it's unlikely that you would get the benefit of the markup.


    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.

    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects and unknown namespaces.

    Thursday, May 07, 2015 3:10 PM
    Moderator
  • Are you writing a Windows Store app or a desktop app?

    Windows Store apps in .Net languages use resx files not .rc files.

    Typically you don't want to include formatting in your localizable resources but would add that when the resource is used.

    To diagnose why the style isn't applied you'll need to determine at what point the problem occurs. Look at how you are loading the resource and make sure it is correct once it's loaded into memory. Likewise check that it's still correct when you load it into whichever control you're displaying it in.

    The details will depend on the type of app and which functions you're calling to load, display, etc. the resource.

    Saturday, May 09, 2015 1:41 AM
    Owner