Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Status Bar Question 2

Status
Not open for further replies.

williamu

Programmer
Apr 8, 2002
494
0
0
GB
I have a status bar on my application that I would like to display a default message. This of course can be done easily with the Properties. However, once I've replaced this text with output from another process how can I reset the default message?

I assume a logical solution to this would be a timer, but does anyone know of another method of doing this?

Any help on this is, as always, appreciated.


William
Software Engineer
ICQ No. 56047340
 
A timer seems like a good choice. The only problem might be that if the process takes some time and the user leaves the computer for some reason (washroom) and comes back after the timer has fired then they might not see the 'process was completed successfully' message.

Other options that come to mind would be,
- Mouse move or got focus event on specific or various controls (depends on the app) or the form.
- Other form events such as actiate.
- Combine the timer with an event.

zemp
 
set a private variable where you change it... then use that to store the original message. i.e.

Private m_StatusMessage As String

Private Sub Form_Load()
StatusBar1.Panels.Add 1, , "This is My Original Message"
End Sub

Private Sub Command1_Click()
Call DisplayNewStatusMessage("This is a new Message")
End Sub

Private Sub Command2_Click()
Call DisplayOldStatusMessage
End Sub

Private Sub DisplayNewStatusMessage(sNewMessage)
m_StatusMessage = StatusBar1.Panels(1).Text
StatusBar1.Panels(1).Text = sNewMessage
End Sub

Private Sub DisplayOldStatusMessage()
StatusBar1.Panels(1).Text = m_StatusMessage
End Sub



Casper

There is room for all of gods creatures, "Right Beside the Mashed Potatoes".
 
Ohhh... missed the real question...

I have a similar program that works int he reverse of what you need. It loks the application after inactivity for a period of time.

In every function that a user could do, like mosue click etc. put a call to a function. My function is Called ActionTaken and inside of it I reset a timer value so that the program won't lock up until there has been inactivity for n minutes. But you could call to reset your default status message.

Casper

There is room for all of gods creatures, "Right Beside the Mashed Potatoes".
 
Thanks guys.

Did a combination of both suggestions, and added the ability to increase the refresh period via the Apps properties.

*'s to you both.


William
Software Engineer
ICQ No. 56047340
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top