Use attached to reproduce.
Workaround: set the property at run time
With the following property settings RadForm does not maximize in order to overlap the taskbar: TopMost - true WindowState = Maximized FormBorderStyle = None
The issue can be reproduced by creating a form with a width of 1200 pixels in an application that is DPI aware. Then the project is run on a tablet with low resolution and an increased DPI, e.g. 1024 x 768 and scaling 120%. Workaround: Public Class RadForm1 Sub New() InitializeComponent() Dim g = Me.CreateGraphics() Dim scale = 96.0 / g.DpiX Me.Size = New Size(scale * Me.ClientSize.Width, scale * Me.ClientSize.Height) g.Dispose() Me.WindowState = FormWindowState.Normal End Sub End Class
Workaround: Sub New() InitializeComponent() AddHandler RadMessageBox.Instance.LocationChanged, AddressOf MsgLocationChanged End Sub Private Sub RadTreeView1_NodeMouseClick(sender As Object, e As Telerik.WinControls.UI.RadTreeViewEventArgs) Handles RadTreeView1.NodeMouseClick If RadMessageBox.Show(Me, String.Format("Change Project to {0}{1}{0}?", Chr(34), e.Node.Text), "Change Project", MessageBoxButtons.YesNo, _ RadMessageIcon.Question, MessageBoxDefaultButton.Button1) = Windows.Forms.DialogResult.Yes Then End If End Sub Private Sub MsgLocationChanged(sender As Object, e As EventArgs) RadMessageBox.Instance.Location = New Point(Me.Location.X + Me.Width / 2, Me.Location.Y + Me.Height / 2) End Sub
How to reproduce: just create a RadForm, in the designer change its size and set its FormBorderStyle property to be None. When the form loads its size will be increased. Workaround: set its MaximumSize property this.MaximumSize = new Size(400, 80);
Steps to reproduce: 1. Build an application targeting x64 platform. 2. Setup your monitors such that one has negative coordinates. 3. Run the application and move a form to the negative coordinates space. 4. You will see a System.OverflowException.
Please refer to the attached sample project and gif file. Workaround: set the AllowTheming property to true.
The attached video shows how you can reproduce this. The issue is easily reproducible on a remote Windows 7 machine.
To reproduce: 1. Add a RadForm with a RadButton and a RadGridView. 2. Use the following code snippet: public Form1() { InitializeComponent(); this.AutoScroll = true; this.radGridView1.Location = new Point(10, 500); } 3. Please refer to the attached gif file. Workaround: Use RadScrollablePanel and dock it inside the form.
UPDATED: this is reproducible in a non-MDI scenario is well. Sub New() InitializeComponent() Me.Size = New Size(500, 500) End Sub To reproduce: 1. Add two RadForms - a parent and a child. 2. Set the MinimumSize property of the child form at design time. 3. Use the following code snippet: public partial class ParentForm : RadForm { public ParentForm() { InitializeComponent(); this.IsMdiContainer = true; ChildForm form = new ChildForm(); form.Text = "MDI Child 1"; form.MdiParent = this; form.Size = new System.Drawing.Size(600, 600); form.Show(); } } public partial class ChildForm : Telerik.WinControls.UI.RadForm { public ChildForm() { InitializeComponent(); this.SizeChanged += ChildForm_SizeChanged; } private void ChildForm_SizeChanged(object sender, EventArgs e) { this.Text = "ChildForm " + this.Size.Width + " x " + this.Size.Height; } } When you run the application with version 2015.2 623, you will notice that the child form is loaded with its MinimumSize. However, in the previous version it is loaded with the expected specified Size(600, 600). Workaround: use ShapedForm with titlebar. An alternative solution is to set the RadForm.Size property in the Shown event.
Workaround: Sub New() InitializeComponent() AddHandler RadMessageBox.Instance.LocationChanged, AddressOf MsgLocationChanged End Sub Private Sub MsgLocationChanged(sender As Object, e As EventArgs) RadMessageBox.Instance.Location = New Point(Me.Location.X + Me.Width / 2 - RadMessageBox.Instance.Width / 2, _ Me.Location.Y + Me.Height / 2) End Sub
MDI control box does not appear when MDI child forms are hidden istead of closed. This happens the second time you are trying to open a previously hidden form right after hiding another MDI child form. Workaround: First, you should add the RadMDIControlsItemExtended class to your real solution and then add the following code snippet in the constructor of the parent MDI form: this.rbMain.RibbonBarElement.ButtonsContainer.Children.RemoveAt(2); RadMDIControlsItemExtended MDIBox = new RadMDIControlsItemExtended(); this.rbMain.RibbonBarElement.ButtonsContainer.Children.Add(MDIBox); MDIBox.LayoutPropertyChanged(); RadMDIControlsItemExtended.cs: using System; using System.Collections.Generic; using System.Text; using Telerik.WinControls.UI; using System.Windows.Forms; using Telerik.WinControls; using System.Reflection; namespace StandardMdiApplication { class RadMDIControlsItemExtended : RadMDIControlsItem { protected override void OnHostFormLayout() { base.OnHostFormLayout(); FieldInfo fi = typeof(RadMDIControlsItem).GetField("hostForm", BindingFlags.NonPublic | BindingFlags.Instance); object o = fi.GetValue(this); Form hostForm = (Form)o; if (hostForm != null && hostForm.IsMdiContainer) { Form maximizedForm = null; foreach (Form form in hostForm.MdiChildren) { if (form is ShapedForm) { foreach (Control mdiFormControls in form.Controls) { if (mdiFormControls is RadTitleBar) { mdiFormControls.Visible = form.WindowState != FormWindowState.Maximized; } } } if (form.WindowState == FormWindowState.Maximized && form.Visible && (maximizedForm == null || hostForm.ActiveMdiChild == form)) { maximizedForm = form; break; } } if (maximizedForm == null) { this.Visibility = ElementVisibility.Collapsed; this.InvalidateMeasure(); return; } FormBorderStyle borderStyle = (maximizedForm is RadFormControlBase) ? ((RadFormControlBase)maximizedForm).FormBorderStyle : maximizedForm.FormBorderStyle; if (maximizedForm != null && maximizedForm.Visible && maximizedForm.ControlBox && borderStyle != FormBorderStyle.None && borderStyle != FormBorderStyle.SizableToolWindow && borderStyle != FormBorderStyle.FixedToolWindow) { this.Visibility = ElementVisibility.Visible; this.InvalidateMeasure(); } else { this.Visibility = ElementVisibility.Collapsed; this.InvalidateMeasure(); } } } } }
The size of RadForm under Windows XP is incorrect when its initial state as MDI child is Maximized and after that the state is changed to Normal. Workaround: Imports Telerik.WinControls.UI Public Class BaseRadForm Inherits RadForm Private Shared LastWindowState As FormWindowState = FormWindowState.Normal Private Shared suspendClientSizeChangedFlag As Boolean = False Protected Overrides Sub OnResizeBegin(ByVal e As System.EventArgs) Me.MaximumSize = New Size(0, 0) MyBase.OnResizeBegin(e) End Sub Protected Overrides Sub OnActivated(ByVal e As System.EventArgs) Me.MaximumSize = New Size(0, 0) MyBase.OnActivated(e) End Sub Protected Overrides Sub OnDeactivate(ByVal e As System.EventArgs) Me.MaximumSize = New Size(0, 0) MyBase.OnDeactivate(e) End Sub Protected Overrides Sub OnClientSizeChanged(ByVal e As System.EventArgs) Dim osInfo As System.OperatingSystem = System.Environment.OSVersion If (suspendClientSizeChangedFlag OrElse osInfo.Version.Major >= 6) Then Return End If If Not LastWindowState.Equals(Me.WindowState) Then LastWindowState = Me.WindowState If Me.WindowState.Equals(FormWindowState.Normal) Then suspendClientSizeChangedFlag = True Me.MaximumSize = New Size(500, 500) suspendClientSizeChangedFlag = False ElseIf Me.WindowState.Equals(FormWindowState.Maximized) Then Me.MaximumSize = New Size(0, 0) End If Else Me.MaximumSize = New Size(0, 0) End If MyBase.OnClientSizeChanged(e) End Sub End Class
If the theme of your Windows 7 is 'Windows 7 Basic' and you have a RadForm as an mdi child., when you maximize this form, you will notice that there is a gap of several pixels between the parent form title bar and the client part of the child form. This can be worked around as shown below: Public Class MDIParent Public Sub New() InitializeComponent() End Sub Dim shouldGetSavedSize As Boolean = False Dim suspendResize As Boolean = False Dim formSize As Drawing.Size = Size.Empty Private Sub RadButton1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadButton1.Click Dim form As RadForm = New RadForm form.MdiParent = Me form.Show() formSize = form.Size AddHandler form.Resize, AddressOf Form_Resize AddHandler form.SizeChanged, AddressOf Form_SizeChanged End Sub Private Sub Form_SizeChanged(ByVal sender As Object, ByVal e As System.EventArgs) Dim form As RadForm = DirectCast(sender, RadForm) If Not form.WindowState = FormWindowState.Maximized Then If suspendResize Then Return End If formSize = form.Size End If End Sub Private Sub Form_Resize(ByVal sender As Object, ByVal e As System.EventArgs) Dim form As RadForm = DirectCast(sender, RadForm) If form.WindowState = FormWindowState.Maximized Then shouldGetSavedSize = True form.FormBorderStyle = Windows.Forms.FormBorderStyle.None Else If shouldGetSavedSize Then shouldGetSavedSize = False suspendResize = True form.FormBorderStyle = FormBorderStyle.Sizable form.Size = formSize suspendResize = False End If End If End Sub End Class
If you have a TextBox anchored to Top, Left, Right in a RadForm, the size that this TextBox gets when the form is shown may not be correct. Workaround: set the Dock = Fill setting after adding the controls/toolwindows in the forms
Hi,
I am working on making our Winforms UI projects DPI aware to clean up fuzzy text in Windows 10.
I'm having an odd issue with some layouts. In one example, we have a simple form dialog that will grow with a label inside (similar to a windows message box). THe label is autosizing itself and has a minimum and maximum size set. This dialog is working fine without the DPI awareness, however, after enabling, the RadForm resizes to some strange size. I tried to investigate and it seems that the label is resizing to some large size and not respecting it's maximums (though this doesn't show when rendering as I've switched off the borders).
The label is resizing the form via anchors. I think probably there is a better way at layout here, but I'm wondering if the wild resizing may be considered a bug.
See images below.
I've also attached a project that reproduces this issue.
To reproduce: 1. Drop a RadGridView and RadButton on Rad Form. 2. Set gris Anchor property to Top-Right-Bottom-Left and the buttons Anchor property to Right-Bottom. 3. Make sure that the RadForm's size is exactly as your desktop resolution(e.g. my 'RadForm' size and desktop resolution are 1920x1080). 4. Change its 'AutoScaleMode' property's value to 'Font'. 5. Build project. 6. Copy the resulted executable on your desktop and name it 'RadControlsWinFormsApp_Font' 7. Select again the RadForm. 8. Change its 'AutoScaleMode' property's value to 'DPI' 9. Build project. 10. Copy the resulted executable on your desktop and name it 'RadControlsWinFormsApp_DPI' 11. Select again the RadForm 12. Change its 'AutoScaleMode' property's value to 'Inherit' 13. Build project 14. Copy the resulted executable on your desktop and name it 'RadControlsWinFormsApp_Inherit' 15. Change your desktop resolution to a lower one (e.g. I've change it from 1920x1080 to 1600x900) 16. 'Auto-Hide' the Window's taskbar 17. Run the executables and see the results: 17.1 In case of 'RadControlsWinFormsApp_Font' application, you should see that the 'RadGridView' control gets truncated + the lower right 'RadButton' is not visible anymore 17.2 In case of 'RadControlsWinFormsApp_DPI' application, you should see that the 'RadGridView' control gets truncated + the lower right 'RadButton' is not visible anymore 17.3 In case of 'RadControlsWinFormsApp_Inherit' application, you should see the controls on the form as you initially placed them. Also this issue appears on 'Windows XP SP3 x86' and also on 'Windows 7 SP1 x64' . Workaround: - Set AutoScaleMode property to None or Inherit.
Updating from Version 2022.1.118 to 2022.1.222 breaks high dpi layout for existing dialogs at 150% DPI scaling:
Expected:
Actual:
Workaround: Use the MS Form