This is a migrated thread and some comments may be shown as answers.

Telerik Theme Problem.

5 Answers 287 Views
Themes and Visual Style Builder
This is a migrated thread and some comments may be shown as answers.
Kashif
Top achievements
Rank 1
Kashif asked on 05 Oct 2019, 06:43 AM

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.

5 Answers, 1 is accepted

Sort by
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 07 Oct 2019, 08:49 AM

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.
0
Kashif
Top achievements
Rank 1
answered on 07 Oct 2019, 10:17 AM

The screenshot which i have provided is from TelerikBlueTheme.

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

0
Kashif
Top achievements
Rank 1
answered on 07 Oct 2019, 10:35 AM

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);
}
0
Accepted
Dess | Tech Support Engineer, Principal
Telerik team
answered on 07 Oct 2019, 10:45 AM
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.
0
Kashif
Top achievements
Rank 1
answered on 07 Oct 2019, 12:29 PM

Thank you very much for the quick reply.

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

 

Tags
Themes and Visual Style Builder
Asked by
Kashif
Top achievements
Rank 1
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Kashif
Top achievements
Rank 1
Share this question
or