c# Label Visible and Invoke
-
03-07-2019 - |
Question
I'm devolping a Windows Mobile aplication in Compact Framework 2.0 SP1.
How can I make invisible a label using invoke?
Thanks!
Solution
You simply want to change the Label's Visible property? Generically speaking it's something like this:
private void SetVisibility(Control target, bool visible)
{
if (target.InvokeRequired)
{
target.Invoke(new EventHandler(
delegate
{
target.Visible = visible;
}));
}
else
{
target.Visible = visible;
}
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow