New topic: Display a label caption for 3 seconds
<http://forums.realsoftware.com/viewtopic.php?t=46806> Page 1 of 1 [ 3 posts ] Previous topic | Next topic Author Message Stuart J Sykes Post subject: Display a label caption for 3 secondsPosted: Sun Feb 03, 2013 5:45 am Joined: Fri Oct 26, 2012 6:24 am Posts: 48 I want to display a label caption for 3 seconds (halting the app around it) - whats the best way? Loop? Timer? label4.text = "Wrong Password - Try Again!" (wait for 3 seconds) label4.text = "" (carry on) Top charonn0 Post subject: Re: Display a label caption for 3 secondsPosted: Sun Feb 03, 2013 6:05 am Joined: Mon Apr 02, 2007 2:08 am Posts: 1104 Location: San Francisco, CA, USA I would suggest disabling the submit button and setting the error text, then re-enabling the button and clearing the error text in the timer's Action event. e.g. (assuming you have a submit button and a timer on the window) label4.text = "Wrong Password - Try Again!" SubmitButton.Enabled = False MyTimer.Period = 3000 '1s=1000ms MyTimer.Mode = Timer.ModeSingle 'Start the clock 'Done. Then, when the timer's period expires, it runs its Action event: Sub Action() label4.text = "" SubmitButton.Enabled = True End Sub _________________ Boredom Software Top Stuart J Sykes Post subject: Re: Display a label caption for 3 secondsPosted: Sun Feb 03, 2013 6:11 am Joined: Fri Oct 26, 2012 6:24 am Posts: 48 Thanks charonn0 ! Top Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending Page 1 of 1 [ 3 posts ] -- Over 1500 classes with 29000 functions in one REALbasic plug-in collection. The Monkeybread Software Realbasic Plugin v9.3. http://www.monkeybreadsoftware.de/realbasic/plugins.shtml [email protected]
