Hi,
I have a ToolStripStaus Lable on my form which informs the user that the new account has been added to the database.
I would only like this message to be displayed for a given time and then be removed, what is the best way to code this
I could do this using a timer control, is there a better way to add pauses within code
Any help would be appreciatted
Me
.ts1.Text = "New Account Created Sucessfully"Ron Nash

Timer
rjhinton
ReeneC,
So to achieve the required result, a timer is the best way
I know how to code the timer event, but was unsure with this is the most efficient way.
Many Thanks
ron
Joey Beninghove
Ron,
From a design perspective, you really want to avoid a design which halts or pauses you application.
A timer is the best and most efficient way to proceed here.
D?vis K?lis
Timer.Enabled = True will start a timer. It's not necessary to use Timer.Start
Using Timer.Start will enable the timer, setting the enabled property true. Using timer.stop will Disable the timer, setting the enabled property false.
(Just for clarification, that is)
errpop
I think it's best if you never think in terms of pauses but in terms of asynchonous events which is what a timer does.
Here is how you might use a timer for your app. (Written from memory)
At the end of you code make your message visible and the code it complete
also: do this...
Tmr.start
Here is relevant timer code. As a member variable:
Protected Friend withevent tmr as new timer
in your load routine do the following and I'll use a five second display time:
tmr.interval=5000
Tmr.enabled = true
In the upper left window of your editor find and select tmr. In the right window select Ticks which will create a timer event handler. It will look something like this
Private Sub tmr_ticks(blah, blah) handles tmr.tick
MessageTextbox.visible= false
tmr.enabled =false
End Sub
There you go............
jvcoach23_23
Thanks to all
A Timer it is then
Ron
AnthonyEY
I know you said its from memory but i dont think simple enable the timer will start it. you will need to do a tmr.start and tmr.stop to start and stop the timer control.
The rest is good.
AlexLancaster
please read it again. .........
As to tmr.stop I used tmr.enabled = false. But in my post I suggested where to put tmr.start
amitmahajan
Thank you SJ,
One thing we can be sure of, that code will start and stop a timer. :)