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

DropdownList and different font size in high DPI screen

3 Answers 546 Views
DropDownList
This is a migrated thread and some comments may be shown as answers.
Vannick
Top achievements
Rank 1
Vannick asked on 26 Dec 2017, 09:39 AM

Hi all,

I have some issues with the control RadDropDownList and particularly with the font size. It seems that the issues appears only with high DPI screen.

I am creating programmatically a RadDropDownList as follow. The drop down list is displayed inside a tablelayoutpanel

 

var radDropDownListCategory = new Telerik.WinControls.UI.RadDropDownList();
radDropDownListCategory.Dock = System.Windows.Forms.DockStyle.Fill;
radDropDownListCategory.Name = $"radDropDownListCategory_{Guid.NewGuid().ToString()}";
radDropDownListCategory.AutoSize = false;
radDropDownListCategory.DropDownAnimationEnabled = false;
radDropDownListCategory.MaximumSize = new System.Drawing.Size(0, 50);
radDropDownListCategory.RootElement.MaxSize = new System.Drawing.Size(0, 50);
radDropDownListCategory.DropDownListElement.ListElement.Font = new System.Drawing.Font("Segoe UI", 9F);
radDropDownListCategory.Font = new System.Drawing.Font("Segoe UI", 9F);
radDropDownListCategory.ListElement.Font = new System.Drawing.Font("Segoe UI", 9F);
radDropDownListCategory.RootElement.Font = new System.Drawing.Font("Segoe UI", 9F);
radDropDownListCategory.AutoSizeItems = true;

 

It seems that with high DPI screen i have the following behavior:

- the dropdown list font size is ok and match my settings (9)

- when i select an element from the dropdown list, the select element is displayed in the textbox but with a font size is much bigger

Do you have any idea how to solve this issue? This issue does not appear with lower dpi screen apparently

 

 

3 Answers, 1 is accepted

Sort by
0
Dimitar
Telerik team
answered on 26 Dec 2017, 01:33 PM
Hello Vannick,

Could you please specify which version of the suite you are currently using? Which is the target framework of the application as well?

First, you can leave the AutoSize and the MaxSize properties intact. The drop-down list is docked in a table layout panel which means that its width will depend on the cell and its height will depend on the font. 

Please note that we are hosting a standard TextBox inside the DropDownList and even if our built-in DPI scaling is disabled the text box will be scaled. In this case, you can set a smaller font. I have attached my test project that shows this. 

Here are some articles about this as well:
I hope this will be useful. Let me know if you have additional questions.

Regards,
Dimitar
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Vannick
Top achievements
Rank 1
answered on 29 Dec 2017, 05:51 AM

Thanks for your response.

FYI, I am using Telerik 2017.3.1017.40 with .NET Framework 4.5.2

I have tried your different remarks and your project also and have found something.

Depending of the control used, the font-size is not displayed the same (RadTextBox vs RadTextBoxControl). Even if I am using the same font size (8.5), the font are rendered differently. The font appears normal in RadTextBox and very small with RadTextBoxControl (RadDropDownList actually have similar behaviour). 
Why such behaviour ?

 

Thanks a lot

 

 

 

 

0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 29 Dec 2017, 10:41 AM
Hello, Vannick, 

Thank you for writing back. 

I have tested the sample project that my colleague, Dimitar, provided on a device with 150% DPI scaling. RadTextBox and RadTextBoxControl were added to the TableLayoutPanel. Note that the MS Form scales its controls automatically. Since RadTextBox hosts the standard MS TextBox, it is automatically enlarged but RadTextBoxControl is not adjusted according to the DPI scaling. I would recommend you to use a RadForm. Thus, both controls, RadTextBox and RadTextBoxControl will have identical look.

I hope this information helps. If you have any additional questions, please let me know. 

 Regards,
Dess
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
DropDownList
Asked by
Vannick
Top achievements
Rank 1
Answers by
Dimitar
Telerik team
Vannick
Top achievements
Rank 1
Dess | Tech Support Engineer, Principal
Telerik team
Share this question
or