Unplanned
Last Updated: 08 Jun 2020 09:05 by ADMIN
Matt
Created on: 24 May 2020 14:18
Category: ContextMenu
Type: Bug Report
0
RadContextMenu: Scale and layout blows up context menu when showing only passing the location

Hi,

I have an issue/query if you wouldn't mind help me out with please.

When using multiple monitors, if the main monitor is on scale and layout 100% and the 2nd monitor is 150%. When showing the context menu it blows the menu up even when shown on the main screen (see attached images).

Is there any way to disable Scale and Layout affecting the scale of the context menu or for the context menu to determine which screen it's being displayed on and use the Scale and Layout for that monitor?

Thanks.

9 comments
ADMIN
Dess | Tech Support Engineer, Principal
Posted on: 08 Jun 2020 09:05

Hello, Matt,

The provided sample project is greatly appreciated.

The first thing that I have noticed is that the referred assemblies in the project are with version 2017.1.221.40:

Please have in mind that Telerik UI for WinForms suite introduced built-in HDPI support in R2 2017. Additional information is available here: https://docs.telerik.com/devtools/winforms/telerik-presentation-framework/dpi-support I would recommend you to upgrade to the latest version in order to ensure that you have all introduced improvements related to DPI scaling.

I have attached a sample gif file illustrating how to access the app. manifest file in VB.NET. The above referred article demonstrates what exactly needs to be added to the app.manifest file in order to make the application DPI-aware.

Should you have further questions please let me know.

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

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
Matt
Posted on: 04 Jun 2020 11:28
Hi Dess,

Thank you again for replying!

This is a strange issue but I think I have found out how you can replicate it.

I can't seem to replicate it in you C# project so I've managed to create a VB project (please find attached)

If you run the project I attached and move either RadForm2 or Form2 to monitor 2 (150%), then show the menu from Form1, this "should" blow it up.

If app.menifest is in the project, moving either form to the 150% doesn't scale it at all. This example only works with app.manifest.

Hope this helps.

Kind regards,

Matt
Attached Files:
ADMIN
Dess | Tech Support Engineer, Principal
Posted on: 04 Jun 2020 09:17
Hello, Matt, 

Indeed, the video illustrates weird behavior.

I have updated the sample project to use two forms and show the RadContextMenu on the second form. Please refer to the attached zip file which contains the modified project and the video illustrating the obtained behavior. It seems to behave properly on my end. Am I missing something? Do I need to perform any changes? 

Please give the sample project a try and see how it works on your end. Feel free to modify it in a way to reproduce the experienced issue and get back to me with it so I can investigate the precise case. Thank you in advance. 

I am looking forward to your reply.

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

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
Matt
Posted on: 01 Jun 2020 15:11

Hi Dess,

Thank you for replying!

After looking further into it, it's not that simple to replicate, my apologies.

I have a video module in my software so my main screen is shown on monitor 1, then my video form is shown on monitor 2 (150%).

To replicate the issue, your video was right. If you had a 2nd form i.e. RadForm2 and show that form using:

Private Sub RadForm1_Load(sender As Object, e As EventArgs) Handles Me.Load

        RadForm2.Show(Me)
End Sub

Move RadForm1 to monitor 1 (100%), then move RadForm2 to monitor 2 (150%). Show the context menu on RadForm1 and you will see the menu is blown up.

One would presume it's due to the fact RadForm2 has been shown setting the owner IWin32Window to RadForm1.

I hope this helps explain further.

Kind regards,

Matt

Attached Files:
ADMIN
Dess | Tech Support Engineer, Principal
Posted on: 01 Jun 2020 14:35

Hi, Matt,

Please refer to the sample video demonstrating the behavior on my end: https://1drv.ms/v/s!AnnV2HsINMD_yw8EXX3yZ3Ez2XNU?e=4TwvuW The same behavior is observed with FormBorderStyle=None.

The context menu seems to be scaled properly on my end on both monitors. I have attached my sample project.  Am I missing something? Could you please specify the exact steps how to reproduce the problem?

Could you please confirm that the dpiAware flag in the app.manifest is set to true/PM on your end? If it is just set to true, please give it a try with true/PM value.

I am looking forward to your reply.

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

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
Matt
Posted on: 29 May 2020 14:06

Hi,

Thank you for your response.

I changed the code to include the control in the Show method but to no avale.

After further investigations, I believe I have found the cause of the problem but can't figure out what I need to do to fix it.

If you follow the scenario as in this thread with multiple monitors, scale and layout etc. But make the main form maximized and set FormBorderStyle=None. Then add an object, context menu, show the context menu and it takes the scale layout from the 2nd monitor.

Hope this helps understand/replicate the issue and be able to provide a workaround please?

Thanks.

Kind regards,

Matt

ADMIN
Dess | Tech Support Engineer, Principal
Posted on: 29 May 2020 12:59
Hello, Matt,  

The provided detailed steps are greatly appreciated. When the RadContextMenu is shown only passing the X,Y coordinates, scaling is not performed. I confirm that we should consider on which monitor the location is found and consider the respective monitor's scale factor.

I have logged it in our feedback portal by making this thread public on your behalf. You can track its progress, subscribe for status changes and add your comments on the following link - feedback item.

I have also updated your Telerik points.

Currently, the possible solution that I can suggest is to use this overload for the Show method that accepts a target control along with the X,Y coordinates. Thus, knowing on which monitor the control is displayed, the scale factor will be considered when showing the menu.

I hope this information helps. If you need any further assistance please don't hesitate to contact me. 

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

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
Matt
Posted on: 27 May 2020 10:32

Hi,

Thank you for your quick response.

I am simply using a standard RadContextMenu showing for example:

    mnuExit.Show(cmdExitMenu.Left, cmdExitMenu.Top)

I'm not sure there is much need to send a project as all you have to do is:

  1. Create a Winforms project
  2. Create a form with a RadContextMenu object
  3. Add a few items in the RadContextMenu
  4. Add a button to show the RadContextMenu

To replicate the issue you will need:

  • 2 monitors
  • Monitor 1, set it to let's say 1920x1080 and 100% scale and layout
  • Monitor 2, set it to let's say 1920x1080 and 150% scale and layout
  • Load the program
  • Show the menu on Monitor 1 - you will notice the menu is blown up as if it's on monitor 2 using monitor 2 scale and layout 150%, not 100%

Hope this helps explain further and you are able to replicate the issue. Do not hestitate to ask me any further questions.

Kind regards,

Matt

 

ADMIN
Dess | Tech Support Engineer, Principal
Posted on: 27 May 2020 10:22
Hello, Matt,  

The provided screenshots are greatly appreciated. However, it wouldn't be easy to determine from a single screenshot what is the exact setup that you have on your end. 
We already have a known issue about incorrect scaling in RadDropDownList. Here is the feedback item for your reference: https://feedback.telerik.com/winforms/1429968-raddropdownlist-the-drop-down-is-not-scaled-correctly-when-using-2-monitors-with-different-dpi 

Are you using a RadDropDownButton, a RadSplitButton or just a RadContextMenu shown on right-clicking.

That is why I would kindly ask you to provide a sample project demonstrating the undesired behavior that you are facing. Thus, we would get better understanding of the precise case, make an adequate analysis of the scenario you have and provide further assistance.

I am converting this forum thread into a support ticket in order to allow attachments. You can find the ticket in Your Telerik Account.

Thank you in advance for your cooperation. I am looking forward to your reply.  

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

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.