How flash statusbar message for one second 
Author Message
 How flash statusbar message for one second

Is there a way to flash a message on the status bar for a given time period,
like one second?  That is, I would like it if when moving from one section
of a Winform to another if the message in the Status bar would change.
Additionally, I would like it not to stay on screen for more than a second
or so.  Optimally, this flash of the message on the status bar for a second
would not interfere with other aspects of data entry.  Hopefully, it would
not put everything else on hold for a second also.

Can this be done?



Wed, 21 Sep 2005 05:56:52 GMT  
 How flash statusbar message for one second
Hi Woody, what you can do is add a timer, set the interval to 1000 and
enabled to false. In the tick event, set the text of the status bar to blank
and the enabled property to false, then when you want the message to appear,
set the statusbar text to the text you need, then set the enabled property
of the timer to true.

--
==============================================
Happy to Help,
Tom Spink

http://dotnetx.betasafe.com > .NET code (soon)

One Day,

Quote:
> Is there a way to flash a message on the status bar for a given time
period,
> like one second?  That is, I would like it if when moving from one section
> of a Winform to another if the message in the Status bar would change.
> Additionally, I would like it not to stay on screen for more than a second
> or so.  Optimally, this flash of the message on the status bar for a
second
> would not interfere with other aspects of data entry.  Hopefully, it would
> not put everything else on hold for a second also.

> Can this be done?



Wed, 21 Sep 2005 06:42:31 GMT  
 How flash statusbar message for one second
Thank you for your reply.

I'm missing something. I did as you directed but when I test it the message
appears and stays on.  It does not go away.

Quote:
> what you can do is add a timer, set the interval to 1000 and
> enabled to false. In the tick event, set the text of the status bar to
blank
> and the enabled property to false

I created the timer in design mode, set interval to 1000 and enabled to
false did the rest as follows:

Private Sub Timer1_Tick(ByVal sender As Object, ByVal e As System.EventArgs)
Handles Timer1.Tick
       StatusBar1.Text = ""
       StatusBar1.Enabled = False
End Sub

Then on a button on the form (for testing purposes only) in the click event
I typed:

StatusBar1.Text = "Hello There"
StatusBar1.Enabled = True

As I said.  The message appears but doesn't go away.  Do I need some sort of
import statement?



Wed, 21 Sep 2005 07:28:49 GMT  
 How flash statusbar message for one second
Hi, sorry I may not have been clear,

The enabled properties should refer to the Timer control,

Quote:
>        StatusBar1.Enabled = False

becomes:
Timer1.Enabled = False

And the same for setting enabled to true. Setting enabled to true on the
timer activates the timer. Sorry,

--
==============================================
Happy to Help,
Tom Spink

http://dotnetx.betasafe.com > .NET code (soon)

One Day,

Quote:
> Thank you for your reply.

> I'm missing something. I did as you directed but when I test it the
message
> appears and stays on.  It does not go away.

> > what you can do is add a timer, set the interval to 1000 and
> > enabled to false. In the tick event, set the text of the status bar to
> blank
> > and the enabled property to false

> I created the timer in design mode, set interval to 1000 and enabled to
> false did the rest as follows:

> Private Sub Timer1_Tick(ByVal sender As Object, ByVal e As
System.EventArgs)
> Handles Timer1.Tick
>        StatusBar1.Text = ""
>        StatusBar1.Enabled = False
> End Sub

> Then on a button on the form (for testing purposes only) in the click
event
> I typed:

> StatusBar1.Text = "Hello There"
> StatusBar1.Enabled = True

> As I said.  The message appears but doesn't go away.  Do I need some sort
of
> import statement?



Wed, 21 Sep 2005 08:23:27 GMT  
 How flash statusbar message for one second
Hello Woody,


Quote:
> Is there a way to flash a message on the status bar
> for a given time period, like one second?  That is,
> I would like it if when moving from one section
> of a Winform to another if the message in the Status
> bar would change.

Put a timer control (Timer1), two texboxes (txtName, txtStreet) and a status
bar (sbStatus) on your form:

\\\
Private Sub Form1_Load( _
    ByVal sender As System.Object, _
    ByVal e As System.EventArgs _
) Handles MyBase.Load
    Me.Timer1.Interval = 2000
    Me.sbStatus.Text = ""
End Sub

Private Sub txtName_GotFocus( _
    ByVal sender As System.Object, _
    ByVal e As System.EventArgs _
) Handles txtName.GotFocus
    Me.sbStatus.Text = "Enter your name"
    StartStatusClearer()
End Sub

Private Sub txtStreet_GotFocus( _
    ByVal sender As System.Object, _
    ByVal e As System.EventArgs _
) Handles txtStreet.GotFocus
    Me.sbStatus.Text = "Enter the street"
    StartStatusClearer()
End Sub

Private Sub StartStatusClearer()
    If Me.Timer1.Enabled = True Then
        Me.Timer1.Enabled = False
    End If
    Me.Timer1.Enabled = True
End Sub

Private Sub Timer1_Tick( _
    ByVal sender As System.Object, _
    ByVal e As System.EventArgs _
) Handles Timer1.Tick
    Me.sbStatus.Text = ""
End Sub
///

Regards,
Herfried K. Wagner



Wed, 21 Sep 2005 08:40:48 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Refresh one of the StatusBarPanel in StatusBar

2. Lest See Here's A Good One, StatusBar

3. How do i intersept statusbar messages ?

4. Update Status message in Statusbar Control

5. Breaking message lines in StatusBar's panel

6. Coloured message in StatusBar

7. Update Status message in Statusbar Control

8. Creating statusbar messages using VB menus

9. StatusBar Error Message

10. Creating statusbar messages using VB menus

11. Creating statusbar messages using VB menus

12. Curious flashing control problem - not the usual one

 

 
Powered by phpBB® Forum Software