prosze o wyjasnienie fragmentu tego kodu, jest to fragment z zajec jedyny jaki udalo mi sie przepisac,ale nie mam pojecia co on ma robic?
o co chodzi z funckjami InvokeRequired / BeginInvoke? oraz z tym delegatem?
delegate void del(Control ctrl, string co, string text);
private void ustawdel(Control ctrl, string co, string text)
{
if (ctrl.InvokeRequired)
{
ctrl.BeginInvoke(new del(ustawdel), ctrl, co, text);
}
else
{
switch (co)
{
case "tekst":
ctrl.Text = text;
break;
case "przycisk":
ctrl.Enabled = Convert.ToBoolean(text);
break;
default:
Console.WriteLine("Default case");
break;
}
}
}