Fixed: wrong icon on second load

This commit is contained in:
Ray committed 2021-09-30 23:09:55 +01:00
1 parent 01cb902536
commit d4c3870732
3 files changed
+61 -161

No files matched your search

+28
View File
@@ -217,6 +217,20 @@ namespace RyzStudio.Windows.Forms
return rv;
}
public static void Add(TreeView parentControl, ImageList control, Image value)
{
if (parentControl.InvokeRequired)
{
parentControl.Invoke(new MethodInvoker(() => {
control.Images.Add(value);
}));
}
else
{
control.Images.Add(value);
}
}
public static void Add(Control parentControl, ImageList control, string key, Image value)
{
if (parentControl.InvokeRequired)
@@ -260,6 +274,20 @@ namespace RyzStudio.Windows.Forms
}
}
public static void Clear(TreeView parentControl, ImageList control)
{
if (parentControl.InvokeRequired)
{
parentControl.Invoke(new MethodInvoker(() => {
control.Images.Clear();
}));
}
else
{
control.Images.Clear();
}
}
public static void Clear(FlowLayoutPanel control)
{
if (control.InvokeRequired)