954,568 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?

TempMsg ( Tempory Message )

0
By cookware_ok on Jul 11th, 2005 2:04 pm

Easily allows temporary message to be displayed on any label for a programmable length of time.
This is a very simple way to display a temporary message on an existing label (or textbox)without doing a lot of coding.

Private Function TempMsg(tempMessage As String, timeInSecs As Single, whichLabel As Object)
        '  ========================
        '  Author: CookWare Ok
        '  ========================
        '  Function may be Public or Private as needed. Remember if used in a module use
        '  WhichForm.WhichLabel format to pass parameter to the function.
        '  EXAMPLE:   Call TempMsg(myMessage, myTime, myForm.myLabel)
        '  ========================
        '  You Must included timer and timer code shown below
        '  ========================
        '  Private Sub timMsg_Timer()
        '  timMsg.Interval = 0
        '  timMsg.Enabled = False
        '  bMsgOn = False
        '  End Sub
        '  ========================
        '  You must also Dim bMsgOn As Boolean (either Public or Private as needed)
        '  =======================
        Dim myMsg As String
        myMsg = whichLabel   '  Stores currently displayed message
        bMsgOn = True
        If timeInSecs > 10 Then   '  Limits time interval to 10 seconds ( May be changed as you see fit )
                timeInSecs = 10
        End If
        timMsg.Interval = timeInSecs * 1000   '  converts timeInSecs to milliseconds
        timMsg.Enabled = True                          '  Starts timer
        Do Until bMsgOn = False                       '  Do tempMessage until time is elapsed
                DoEvents
                whichLabel = tempMessage
        Loop
        whichLabel = myMsg   '  Restores original message
End Function

Wow, this difficult to read! Why are there so many "you must" in there?

bumsfeld
Nearly a Posting Virtuoso
1,445 posts since Jul 2005
Reputation Points: 404
Solved Threads: 184
 

It's not that difficult to read. You don't really need the comments if you know what you're doing in VB.

linux
Posting Shark
933 posts since Aug 2006
Reputation Points: 118
Solved Threads: 30
 

He must..

ahihihi...
Practically a Master Poster
603 posts since Jan 2009
Reputation Points: 115
Solved Threads: 5
 
Easily allows temporary message to be displayed on any label for a programmable length of time. This is a very simple way to display a temporary message on an existing label (or textbox)without doing a lot of coding.


yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy

muzaffar85
Newbie Poster
2 posts since Nov 2009
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You