|
-
May 25th, 2005, 10:40 AM
#1
Thread Starter
Lively Member
Quick & Easy StatusBar Question
I want to display text in a StatusBar for 1000ms or maybe 2000ms. Do I need a timer, or is there a built in property in the StatusBar control for handling this?
And if I do need a timer, what's the syntax for using that?
Thanks,
CP
-
May 25th, 2005, 10:56 AM
#2
Re: Quick & Easy StatusBar Question
you need to use a timer.
place the following code inside the tick event of a timer, and start the timer when you want the text to show.
VB Code:
Static counter as Integer
If counter = 1 Then
Timer1.Stop
counter = 0
StatusBar1.Text = String.Empty
Else
counter += 1
StatusBar1.Text = "your text here"
End If
EDIT: don't forget to set the timer interval to the required value.
-
May 25th, 2005, 11:26 AM
#3
Thread Starter
Lively Member
Re: Quick & Easy StatusBar Question
Thanks for the help. Here's some more info . . .
I'm displaying various texts in the status bar depending on button clicks, etc. How do I display the text per click?
Example: I am using a delete button to delete a db record. Instead of showing a msgbox the the record has been deleted and forcing the user to click OK every time, I'd rather just display a message in the status bar for a couple of seconds.
Am I complicating this, or is it just a variation of what you already gave me?
Thanks!
CP
-
May 25th, 2005, 11:34 AM
#4
Re: Quick & Easy StatusBar Question
Just enable your timer in the click event of the delete button. Then when the ime has elapsed you disable your timer.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
May 25th, 2005, 01:13 PM
#5
Thread Starter
Lively Member
Re: Quick & Easy StatusBar Question
<kip>That sounds pretty good.</kip>
<lloyd>That sounds good, I'll try that</lloyd>
-
May 26th, 2005, 10:35 AM
#6
Thread Starter
Lively Member
Re: Quick & Easy StatusBar Question
-
May 26th, 2005, 11:13 AM
#7
Re: Quick & Easy StatusBar Question
Add a timer control to your form and add some code something like so.
VB Code:
Private Sub frmMain_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Me.Timer1.Enabled = False
Me.Timer1.Interval = 5000 'Miliseconds
End Sub
Private Sub tmrTimer_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles tmrTimer.Tick
Me.StatusBarDescription.Text = String.Empty
Me.Timer1.Enabled = False
End Sub
Public Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Me.StatusBarDescription.Text = "Processing Update..."
Application.DoEvents()
Me.Timer1.Enabled = True
'Do your update stuff
'...
'...
End Sub
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|