Telerik Theme Problem.

6 posts, 1 answers
  1. Kashif
    Kashif avatar
    66 posts
    Member since:
    Jan 2019

    Posted 05 Oct 2019 Link to this post

    Hi Admins.

    I am developing an application which have the functionality to change the theme at rune time.

    When i use the Telerik Themes. Message on the RadMessaageBox not shown properly (see attached image)

    the code for displaying the MesageBox is

    string msg = "<html>Are you sure?<br><br><b>You want to close the Application</b></html>";
    DialogResult result = RadMessageBox.Show(msg, "Sales Digitization", MessageBoxButtons.OKCancel, RadMessageIcon.Question, MessageBoxDefaultButton.Button1);

     

    Is this theme problem that is not compatible with html tags.

  2. Dess | Tech Support Engineer, Sr.
    Admin
    Dess | Tech Support Engineer, Sr.  avatar
    3991 posts

    Posted 07 Oct 2019 Link to this post

    Hello, Kashif,    

    According to the provided screenshot, it seems that you are using the Fluent theme to your application. I have tested the provided code and it displays the message box as expected:

    Have you changed the font of the message box? Because the different fonts may result in different result when rendering the text. 

    By default we use GDI+ to measure the text, however, GDI+ is a known suspect for reporting wrong sizes of the text and this is also the case here. You can easily force the element to use GDI instead of GDI+ by setting the UseCompatibleTextRendering property to false and this should improve the rendering of normal text. However, for HTML-like text rendering, the possible solution that I can suggest is to use a suitable font.

    I am looking forwrad to your reply.

    Regards,
    Dess | Tech Support Engineer, Sr.
    Progress Telerik

    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
  3. Kashif
    Kashif avatar
    66 posts
    Member since:
    Jan 2019

    Posted 07 Oct 2019 in reply to Dess | Tech Support Engineer, Sr. Link to this post

    The screenshot which i have provided is from TelerikBlueTheme.

    i have not apply any kind of fond on MessageBox. It is using default font.

  4. Kashif
    Kashif avatar
    66 posts
    Member since:
    Jan 2019

    Posted 07 Oct 2019 in reply to Dess | Tech Support Engineer, Sr. Link to this post

    Fluent Theme is also working fine at my end.

    I was complaining  about TelerikMetroBlue and TelerikMetro themes

    Please check the attached image, it is taken from the sample project you have attached in the previous post, I have only added TelerikMetro theme

    public RadForm1()
    {
        InitializeComponent();
     
        ThemeResolutionService.ApplicationThemeName = "TelerikMetro";
     
        string msg = "<html>Are you sure?<br><br><b>You want to close the Application</b></html>";
        DialogResult result = RadMessageBox.Show(msg, "Sales Digitization", MessageBoxButtons.OKCancel, RadMessageIcon.Question, MessageBoxDefaultButton.Button1);
    }
  5. Answer
    Dess | Tech Support Engineer, Sr.
    Admin
    Dess | Tech Support Engineer, Sr.  avatar
    3991 posts

    Posted 07 Oct 2019 Link to this post

    Hello, Kashif,    

    I suppose that you mean TelerikMetroBlue theme. Indeed, with HTML-like text, the text rendering is not as expected with the default font for the theme. However, you can improve the text rendering by changing the TextRenderingHint as follows: 
       ((RadLabel)RadMessageBox.Instance.Controls["radLabel1"]).LabelElement.LabelText.TextRenderingHint = System.Drawing.Text.TextRenderingHint.AntiAlias;

    Could you please give a try and see how it works on your end?

    Regards,
    Dess | Tech Support Engineer, Sr.
    Progress Telerik

    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
  6. Kashif
    Kashif avatar
    66 posts
    Member since:
    Jan 2019

    Posted 07 Oct 2019 in reply to Dess | Tech Support Engineer, Sr. Link to this post

    Thank you very much for the quick reply.

    Its Working, Just apply this code at the application startup.

     

Back to Top