Jump to content

Desaparecer e voltar a aparecer novo texto C#


Recommended Posts

Posted

boas

Estou com uma ideia e gostaria que me podessem ajudar!

Bem, eu no meu projecto queria meter um Menu! ....

Bem, nesse Menu eu queria colocar um Label, depois esse Label passado 3/4 segundos desaparecia e voltava a aparecer outro Label, mas com a escrita diferente!

Tipo, no 1º Label que aparece-se queria: Menu

2º Label Clica para aceder ao Menu

Podem-me ajudar?

Estou a fazer em C#

obrigado

cumps

Visual Studio 2010 C#

Posted

Tipo, criar um Label e nesse Label escrever tipo "Menu"

Depois passado alguns segundos esse mesmo Label muda de nome!

De "Menu" para "Clica para aceder"!

O Label muda automaticamente passado alguns segundos

Visual Studio 2010 C#

Posted

Por exemplo:

class Program
    {
        static Timer myTimer = new Timer();

        public static void Main(string[] args)
        {            
            myTimer.Elapsed += new ElapsedEventHandler( DisplayTimeEvent );
            myTimer.Interval = 1000;
            myTimer.Start();

            Console.WriteLine("Menu");

            while (!Console.Read().Equals("sair"))
            { 
                //nao faz nada...
            }
        }

        public static void DisplayTimeEvent( object source, ElapsedEventArgs e )
        {
            Console.WriteLine("O texto mudou sozinho!");
            myTimer.Stop();
        }
    }

Isto está para Console. Agora mudas como te convém.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.