Question

I'm devolping a Windows Mobile aplication in Compact Framework 2.0 SP1.

How can I make invisible a label using invoke?

Thanks!

Was it helpful?

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
scroll top