private void EnableGui(Control control, bool enabled)
{
foreach (Control c in control.Controls)
{
EnableGui(c, enabled);
}
control.Enabled = enabled;
}
{
foreach (Control c in control.Controls)
{
EnableGui(c, enabled);
}
control.Enabled = enabled;
}
With UIThreadInvoke:
private void EnableGui(Control control, bool enabled)
{
this.UiThreadInvoke(() =>
{
foreach (Control c in control.Controls)
{
EnableGui(c, enabled);
}
control.Enabled = enabled;
});
}
{
this.UiThreadInvoke(() =>
{
foreach (Control c in control.Controls)
{
EnableGui(c, enabled);
}
control.Enabled = enabled;
});
}
Keine Kommentare:
Kommentar veröffentlichen