Duplicated
Last Updated: 26 Aug 2020 14:01 by ADMIN
Matt
Created on: 25 Aug 2020 07:58
Category: UI for WinForms
Type: Bug Report
0
Frameless maximized form size is wrong

Hi,

I am trialing version 2020.2.504.40 from 2017.1.221.40 and have found an issue converting my current project. Before upgrading I need to get this resolved if you could help please?

If you:

  • Add a Telerik form to a new WinForms project
  • Set FormBorderStyle = Windows.Forms.FormBorderStyle.None
  • Set WindowState = FormWindowState.Maximized
  • Show the height and width of the form, i.e. in Me.Resize, put Me.Text = "Width: " & Me.Width & ", Height: " & Me.Height

I have a monitor of 1920x1080. When the form is resized it shows a size of 1934x1094. I have tried setting Me.AllowTheming=False (no avail) and also tried in form Properties > FormBehaviour > AllowTheming=False (but to no avail).

The form size works as expected in 2017.1.221.40.

Kind regards,

Matt

Duplicated
This item is a duplicate of an already existing item. You can find the original item here:
7 comments
ADMIN
Dess | Tech Support Engineer, Principal
Posted on: 26 Aug 2020 14:01
Hello, Matt,

Indeed, this is an issue that wouldn't be easily fixed. However, we will do our best to introduce a fix accordingly. Please make sure that you cast your vote for the item in order to increase its priority. In addition, click the Follow button in order to get notified when the status of the feedback item is changed.

As to the automatic conversion to a MS Form, I believe that the RadFormConverter would fit your case. It is a component which can be used in the designer of Visual Studio. It allows an easy conversion between RadForm, RadRibbonForm, and the standard Form. Additional information is available in the following help article: https://docs.telerik.com/devtools/winforms/controls/forms-and-dialogs/form-converter  

Should you have further questions please let me know.

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

Five days of Blazor, Angular, React, and Xamarin experts live-coding on twitch.tv/CodeItLive , special prizes and more, for FREE?! Register now for DevReach 2.0(20).

Matt
Posted on: 26 Aug 2020 12:27

Hi Dess,

Thank you for trying to come up with a solution, however my form can not be TopMost due to the fact our customers open File Explorer etc contantly - given this they would never be able to see the File Explorer window.

I presume this is an issue that isn't going to be a quick fix or to find a suitable workaround...

The only other option is for me to use Windows Forms instead of Telerik Forms in this instanse. Do you know of a quick way to convert Telerik Forms back to Windows Forms as I have about 19 forms to convert? I have tried simply changing Inherits:

     Inherits Telerik.WinControls.UI.RadForm > Inherits System.Windows.Forms.Form

This however comes up with the following error (any help would be appreciated):

ADMIN
Dess | Tech Support Engineer, Principal
Posted on: 26 Aug 2020 11:49
Hello, Matt,

Due to the specificity of the problem, the possible solution that I can suggest is to comment the maximized state and simulate the maximum size as follows: 
    Sub New()

        InitializeComponent()
        Me.FormBorderStyle = Windows.Forms.FormBorderStyle.None
        Me.StartPosition = FormStartPosition.Manual
        Me.Location = New Point(0, 0)
        Me.TopMost = True
        Me.Size = Screen.PrimaryScreen.Bounds.Size
        Me.MaximumSize = Screen.PrimaryScreen.Bounds.Size

        'Me.WindowState = FormWindowState.Maximized 

    End Sub

I have attached my sample project for your reference.

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

Five days of Blazor, Angular, React, and Xamarin experts live-coding on twitch.tv/CodeItLive , special prizes and more, for FREE?! Register now for DevReach 2.0(20).

Attached Files:
Matt
Posted on: 26 Aug 2020 10:40

Hi Dess,

Thank you for the workaround however this doesn't work for my project.

If I set the MaximumSize = New Size(1920,1080) then maximize the form as normal, for some reason once this is done the screen automatically sets me.Top = -7 and me.Left = -7 (me.Width and me.Height is correct now) but therefore creates an edge around the form on the right and bottom. Due to the fact the form is Maximized you are obviously unable to set me.Top = 0 and me.Left = 0 as they keep reverting to -7

Furthermore the form doesn't take over the whole area and still shows the TaskBar (see below)

Can you sugeest something else please?

Kind regards,

Matt.

ADMIN
Dess | Tech Support Engineer, Principal
Posted on: 26 Aug 2020 08:06
Hello, Matt,

Thank you for specifying that you are running the application at 100% DPI scaling. In this case the app.manifest file is not related to the form's size. 

I would like to that if you need just the area a standard application would use, i.e. excluding the Windows taskbar and docked windows, the Screen.WorkingArea property will give you the size value. Otherwise, the Screen.Bounds property will give you the entire screen area.

Indeed, the RadForm.Size property is bigger than the screen resolution in the specified case. We already have a similar issue logged in our feedback portal.You can track its progress, subscribe for status changes and add your comments on the following link - feedback item.

Currently, the possible solution that I can suggest is to specify the MaximumSize of the RadForm.

Should you have further questions please let me know.

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

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Matt
Posted on: 25 Aug 2020 13:31

Hi,

Thanks for your reply however I have tried everything from the links you provided but nothing is setting the form width and height to the correct 1920x1080, it always comes out at 1934x1094.

Furthermore, my Scale and Layout is set to 100% so that's not an issue (as shown below).

I've even tried to add a form to the FileExplorer sample Telerik provide to do the same but again it doesn't work.

If you are able to open a new project, set a form with no frame, maximized etc and the form to be the correct size - can you provide me with the code to do so please. Changing the manifest file config files isn't working.

I understand having the FormBorderStyle.None, is expected to occupy the entire monitor's space and doesn't allow resizing. That is why I have it so the users can't resize or minimize the application, thus it is imperative to get this working if I am to upgrade from 2017.

Kind regards,

Matt

 

ADMIN
Dess | Tech Support Engineer, Principal
Posted on: 25 Aug 2020 12:30

Hello, Matt,

If the form is maximized and with FormBorderStyle.None, it is expected to occupy the entire monitor's space and doesn't allow resizing. 

However, according to the provided screenshot, I suppose that your application is declared as DPI aware and this is expected to affect the form's size. I would like to note that in R2 2017 we introduced built-in HDPI support in the Telerik UI for WinForms suite. This coincides with the HDPI improvements Microsoft is bringing with .NET 4.7 and the Windows 10 Creators Update. The best part is that you will get this support no matter which .NET framework you are targeting (currently supported from .NET 2.0 and up). If you don't want the form to be affected by the scale factor of the monitor, you can decalre the application as DPI unaware. Additional information is available in the following help article: https://docs.telerik.com/devtools/winforms/telerik-presentation-framework/dpi-support 

If your development machine has HDPI monitor and the scaling setting are larger than 100%, this can cause issues with the layout because opening the designer on such machines will set the AutoScaleDimensions property (the default value is SizeF(6F, 13F)). This property is used when a scaling factor is calculated and passed to your application. And if a wrong factor is passed the application can look smaller or larger then it should be. Please make sure that you open the designer at 100% DPI scaling and this property has its default value (SizeF(6F, 13F)). There is a warning in Visual Studio that recommends developing on 100%: https://docs.telerik.com/devtools/winforms/knowledge-base/hdpi-tips-and-tricks 
 
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

Five days of Blazor, Angular, React, and Xamarin experts live-coding on twitch.tv/CodeItLive , special prizes and more, for FREE?! Register now for DevReach 2.0(20).

Attached Files: