ensure the flyout is closed before opening a new one
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
using System.ComponentModel;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using Telerik.WinControls;
|
||||
using Telerik.WinControls.UI;
|
||||
|
||||
@@ -27,6 +26,8 @@ public partial class RadFlyoutBase : UserControl
|
||||
[DefaultValue(true)]
|
||||
public bool RegisterDialogCancel { get; set; } = true;
|
||||
|
||||
public new Size PreferredSize { get; set; } = Size.Empty;
|
||||
|
||||
[DefaultValue(true)]
|
||||
public virtual bool ActionPanelVisible
|
||||
{
|
||||
@@ -224,9 +225,20 @@ public partial class RadFlyoutBase : UserControl
|
||||
frm.AutoSize = true;
|
||||
frm.AutoSizeMode = AutoSizeMode.GrowAndShrink;
|
||||
}
|
||||
|
||||
frm.Shown += Form_Shown;
|
||||
}
|
||||
}
|
||||
|
||||
private void Form_Shown(object? sender, EventArgs e)
|
||||
{
|
||||
if (FindForm() is not Form frm)
|
||||
return;
|
||||
|
||||
if (!AutoSize)
|
||||
frm.ClientSize = PreferredSize;
|
||||
}
|
||||
|
||||
protected void Close(DialogResult result)
|
||||
{
|
||||
Result = result;
|
||||
|
||||
Reference in New Issue
Block a user