Fix Bug in Dotnet Bar related to multiple events and closing display tabs

This commit is contained in:
2026-05-12 08:54:26 -04:00
parent 727491f99b
commit 768fcc4f05
@@ -887,9 +887,18 @@ namespace Volian.Controls.Library
Bar b = myTabItem.ContainerControl as Bar; Bar b = myTabItem.ContainerControl as Bar;
if (b != null) if (b != null)
{ {
b.CloseDockTab(myTabItem); try
//b.Items.Remove(myTabItem); {
RemoveItem(myTabItem); b.CloseDockTab(myTabItem);
}
catch
{
//This is to work around a bug inside 3rd party DotNetBar
//The bug occurs when events happen out of order and it tries
//to remove a TabItem from the Collection the has already been removed
}
RemoveItem(myTabItem);
} }
} }
/// <summary> /// <summary>