Hello I am trying to show a label when the condition is true and I want it to be timed controlled so it will disappear in a couple of seconds.The program is an app and uses the .xaml extension, it does not have forms. The examples I have found online are when the label is handled by an event, not by a conditional statement. Any help appreciated.

 private void InterpretCommand(SpeechRecognizedEventArgs e)
        {


            if (e.Result.Text == "Start")         // initially only recognize starting and ending voice control   
            {
                activeVoiceControl = true;

                aTimer = new System.Timers.Timer(3000);
                label1.Visibility = Visibility.Visible;
                aTimer.Start();
                aTimer.Stop();
                label1.Visibility = Visibility.Collapsed;
            }
        }

Your use of the timer control is incorrect. The principle is the same; set a callback for your timer (I think it's called Tick or similar) in that callback, you need to collapse your label and stop the timer.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.