views:

1114

answers:

1

Hi!

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

How can I make invisible a label using invoke?

Thanks!

+3  A: 

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;
    }
}
ctacke