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;
}
}
}
}