To workaround this issue you should dispose the Instance property of RadMessageBox after each show of message box. For example: WORKAROUND: RadMessageBox.Show("Text"); RadMessageBox.Instance.Dispose(); If you are using themes, consider the following approach: RadMessageBox.SetThemeName("Windows7"); RadMessageBox.Show("This is some long text that sometimes does not wrap as it should."); var field = typeof(RadMessageBox).GetField("radMessageBoxForm", BindingFlags.NonPublic | BindingFlags.Static); field.SetValue(null, null);
When you set the FormBorderStyle property to FormBorderStyle.None, the form size defined initially is changed.
To reproduce: Add a RadForm and set its icon property. You will notice that the Form's icon is changed but it is not in the taskbar.
FIX. RadForm text flickers on change
To reproduce: - Create a RadForm with a public label in it. - Inherit the new form and change the label text. - Open the second form at design time - the file status is changed to modified.
To reproduce: - Create a new form. - Change the Localizable property to true. - Add a RadLabel to the form. - Select the label and change its name to "name with space" and press Enter. - VS editor will say that it is an invalid name and return the name to previous value. - Now look at designer.cs file of the form and you will see a lot of RootElement properties getting values form resource! Same issue can be reproduced by localizing a custom control: - Open UserControl.cs in Design mode. - On property editor, change property Language from "(Default)" to "Portuguese (Brazil)". - Now change a label text to "Nome". - See file EditUserControl.Designer.cs. It has many RootElement lines! Workaround: Delete the generated code and rebuild.
To reproduce:
1. Create a new .NET 7 project and add a RadForm to it with a single control (e.g. RadButton).
2. Open the designer and have a look at the form's Size.
3. Move the button and save the changes
4. Close the designer and open it again.
Expected result: the RadForm's Size is unchanged
Actual result: the RadForm gets smaller, its height is reduced.
A possible workaround is to set the RadControl.EnableDpiScaling property to false. static class Program { /// <summary> /// The main entry point for the application. /// </summary> [STAThread] static void Main() { RadControl.EnableDpiScaling = false; Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new RadForm1()); } } Another workaround is to mark the application as DPI-aware: https://docs.telerik.com/devtools/winforms/telerik-presentation-framework/dpi-support
FIX. RadRibbonForm - setting the FormBorderStyle property does not take effect
When RadMessageBox has not owner and it is using in form that has TopMost = true throws exception after first call of RadMessageBox.Show() Steps to reproduce: 1.Create From with TopMost = true 2. Add button and insert the following code in press event: RadMessageBox.Show("Text"); 3.Run application and press the button two times. Workaround after each show of RadMessageBox add this code snippet: RadMessageBox.Instance.Dispose();
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"
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(); } }
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; } }
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; } } } }
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.
Default button focus is not correct and additional tab press is needed.
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.
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).