To reproduce: - Set the form MinimumSize to or close to the RadForm's actual size. - Turn all windows visual effects off - Set the theme to Office2010Silver - Start the application Workaround: - Load the theme manually in code like this: ThemeResolutionService.LoadPackageFile("C:\Office2010Silver.tssp") ThemeResolutionService.ApplicationThemeName = "Office2010Silver"
When the RadForm is used as MDI Child hosted by RadDock, the rendering of the form is not appropriate.
Workaround: set the RadRibbonFormBehavior1.AllowTheming property of the form to false public class RadForm1 { public RadForm1() { InitializeComponent(); this.RadRibbonFormBehavior1.AllowTheming = false; } }
How to reproduce: 1. Maximize a RadForm on a remote desktop machine using 2016.2.608 version 2. Maximize a RadForm on a Windows 7 machine with a disabled Aero using 2016.2.608 version 3. Maximize a RadForm on a Windows Server 2003 R2 using 2016.2.608 version 4. Maximize a RadForm on a Windows Server 2008 R2 using 2016.2.608 version Workaround: public partial class RadForm1 : RadForm { public RadForm1() { InitializeComponent(); } //Workaround protected override Telerik.WinControls.RootRadElement CreateRootElement() { return new MyFormRootElement(this); } } public class MyFormRootElement : FormRootElement { private RadForm formControl; public MyFormRootElement(RadForm radForm1) : base(radForm1) { } protected override Type ThemeEffectiveType { get { return typeof(RootRadElement); } } protected override void OnPropertyChanged(RadPropertyChangedEventArgs e) { this.formControl = this.GetType().BaseType.GetField("formControl", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(this) as RadForm; if (e.Property == RadElement.BoundsProperty) { if ((this.Shape != null) && (this.formControl != null) && this.ApplyShapeToControl) { Rectangle oldBounds = (Rectangle)e.OldValue; Rectangle newBounds = (Rectangle)e.NewValue; if (oldBounds.Size != newBounds.Size) { CreateRegionFromShape(newBounds.Size); } } } else if ((e.Property == ShapeProperty) && this.ApplyShapeToControl) { ElementShape shape = e.NewValue as ElementShape; if ((shape != null) && (this.ElementTree != null)) { CreateRegionFromShape(this.Size); } } else if (e.Property == ApplyShapeToControlProperty) { if ((bool)e.NewValue && this.Shape != null) { CreateRegionFromShape(this.Size); } else { this.ElementTree.Control.Region = null; } } else { base.OnPropertyChanged(e); } } private void CreateRegionFromShape(Size regionSize) { Region newRegion = null; this.formControl = this.GetType().BaseType.GetField("formControl", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(this) as RadForm; if (this.formControl.WindowState != FormWindowState.Maximized || this.formControl.MaximumSize != Size.Empty) { Rectangle boundsRect = new Rectangle(Point.Empty, regionSize); using (GraphicsPath path = this.Shape.CreatePath(boundsRect)) { newRegion = new Region(path); } } else if (!(IsWindows7 && !DWMAPIHelper.IsCompositionEnabled)) { int borderLenght = DWMAPIHelper.IsCompositionEnabled ? SystemInformation.FixedFrameBorderSize.Height : SystemInformation.FrameBorderSize.Height; borderLenght += borderLenght; if (!IsWindows8OrHigher) { borderLenght += 2; } else { borderLenght += 1; } Rectangle boundsRect = new Rectangle(new Point(borderLenght, borderLenght), new Size(regionSize.Width - (borderLenght * 2), regionSize.Height - (borderLenght * 2))); using (GraphicsPath path = new GraphicsPath()) { path.AddRectangle(boundsRect); newRegion = new Region(path); } } Region region = this.formControl.Region; if (!AreEqualRegions(region, newRegion)) { this.formControl.Region = newRegion; } } private bool IsWindows8OrHigher { get { OperatingSystem os = Environment.OSVersion; return os.Platform == PlatformID.Win32NT && (os.Version.Major > 6 || (os.Version.Major == 6 && os.Version.Minor >= 2)); } } private bool IsWindows7 { get { OperatingSystem os = Environment.OSVersion; return os.Platform == PlatformID.Win32NT && ((os.Version.Major == 6 && os.Version.Minor == 1) || os.Version.Major < 6); } } private static bool AreEqualRegions(Region regionX, Region regionY) { if (regionX == null && regionY == null) { return true; } if (regionX == null || regionY == null) { return false; } byte[] regionDataX = regionX.GetRegionData().Data; byte[] regionDataY = regionY.GetRegionData().Data; int length = regionDataX.Length; if (length != regionDataY.Length) { return false; } for (int i = 0; i < length; i++) { if (regionDataX[i] != regionDataY[i]) { return false; } } return true; } } internal class DWMAPIHelper { [DllImport("dwmapi.dll")] public static extern void DwmIsCompositionEnabled(ref bool isEnabled); public static bool IsVista { get { return Environment.OSVersion.Version.Major >= 6; } } public static bool IsCompositionEnabled { get { if (!IsVista) { return false; } bool enabled = false; DwmIsCompositionEnabled(ref enabled); return enabled; } } } }
RadMessageBox throws ArgumentException - "A circular control reference has been made. A control cannot be owned by or parented to itself." when using with MDI forms. WorkAround: RadMessageBox.Show("Text"); RadMessageBox.Instance.Dispose();
If you have a RadForm that contains a RadTextBox (TextBox), set the WindowsState of this form to Maximized and add this form to an MDI Parent with RadDock which handles the forms, you will notived that you are not able to mouse select the text.
Default button focus is not correct and additional tab press is needed.
Use attached to reproduce. Case 1 - the initial scaling is not correct and the showing dilog1 results in a different DPI each time. Case 2 - the AllowTheming property disabled the scaling - see dialog 2. Workaround: this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi; this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F); public class MyRadForm : RadForm { protected override void HandleDpiChanged() { if (TelerikHelper.IsWindows10CreatorsUpdateOrHigher) { return; } base.HandleDpiChanged(); } }
Steps to reproduce: 1. Create an application with RadForm and few controls under .Net 4.7 2. Start the application on 4K monitor (primary screen) with high DPI (200-percent scale) 3. The form is not scaled correctly. Windows do not send the message that the scale factor is changed. The issue is observed when the form is initially starting on high DPI (125-percent or higher).
To reproduce: - Create new project. - Make the default form to inherit RadForm. - Start the application and maximize the form. - You will notice that a few pixels are displayed on the right monitor as well. Workaround: var screen = System.Windows.Forms.Screen.PrimaryScreen.Bounds; this.MaximumSize = new Size(screen.Width, screen.Height); Second Workaround: public Form1() { InitializeComponent(); this.SizeChanged += Form1_SizeChanged; } private void Form1_SizeChanged(object sender, EventArgs e) { if (this.WindowState == FormWindowState.Maximized) { this.Region = null; } }
When the Font of the form changes (or the DPI setting), RadForm should be able to arrange its content so that no controls are overlapped. In addition, RadForm should increase its size when necessary.
To reproduce: RadForm form = new RadForm(); form.WindowState = FormWindowState.Maximized; form.Text = string.Format("Child {0}", MdiChildren.Length + 1); form.MdiParent = this; form.Show(); Hover the Form's title bar the tooltip should start flashing/blinking
To reproduce: Add a RadRibbonBar, associate AcceptButton and CancelButton and subscribe to their events. Run the application press escape and the CancelButton's event should be fired. Press enter - no results. Workaround: protected override bool ProcessCmdKey(ref System.Windows.Forms.Message msg, System.Windows.Forms.Keys keyData) { if (keyData == System.Windows.Forms.Keys.Enter) { this.AcceptButton.PerformClick(); } return base.ProcessCmdKey(ref msg, keyData); } Resolution: The issue is fixed in Telerik`s RadForm and RadRibbonForm. If you use MS Form, this is still not working.
To reproduce: public partial class RadRibbonForm1 : Telerik.WinControls.UI.RadRibbonForm { public RadRibbonForm1() { InitializeComponent(); this.AllowAero = true; this.RibbonBar.QuickAccessToolbarBelowRibbon = false; } } Note: the system buttons not always handle the mouse click. Workaround: set AllowAero to false OR RibbonBar.QuickAccessToolbarBelowRibbon to true.
Steps to reproduce: - add RadForm to the project - drop a RadRibbonBar to the project - when asked to use RadRibbonFormBehavior, confirm with Yes - check the form size (height) and close it - reopen it and the size is changed - repeating the last two steps continues to increase the form height Workaround: change the parent of the form having the ribbon form behavior public partial class RadForm1 : CustomRadForm { public RadForm1() { InitializeComponent(); } } public class CustomRadForm : Telerik.WinControls.UI.RadForm { public new FormControlBehavior FormBehavior { get { return (FormControlBehavior)typeof(RadFormControlBase) .GetField("formBehavior", BindingFlags.Instance | BindingFlags.NonPublic) .GetValue(this); } set { this.ResetFormBehavior(false); if (value != null) { Size clientSize = this.ClientSize; typeof(RadFormControlBase) .GetField("formBehavior", BindingFlags.Instance | BindingFlags.NonPublic) .SetValue(this, value); typeof(RadFormControlBase) .GetMethod("PrepareBehavior", BindingFlags.Instance | BindingFlags.NonPublic) .Invoke(this, new object[] { }); this.RecreateHandle(); this.ClientSize = clientSize; } } } }
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
The attached video shows how you can reproduce this. The issue is easily reproducible on a remote Windows 7 machine.
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);
Please refer to the attached sample project and gif file. Workaround: set the AllowTheming property to true.