• Earn real money by being active: Hello Guest, earn real money by simply being active on the forum — post quality content, get reactions, and help the community. Once you reach the minimum credit amount, you’ll be able to withdraw your balance directly. Learn how it works.

Visual Basic Typing Effect Routine

Status
Not open for further replies.

Kaway

Banned
User
Joined
Aug 7, 2014
Messages
720
Reputation
0
Reaction score
5,766
Points
243
Credits
0
‎10 Years of Service‎
15%
Please note, if you want to make a deal with this user, that it is blocked.
[HIDE-THANKS]

TypingEffect(msg As String, time)

- returns none

parameters

msg , the message to be displayed

first create a form, with a textbox and a button

Code:
>Sub delay(time)
   Start = Timer
   Do While Timer - Start < time
       DoEvents
   Loop
End Sub

Private Sub Command1_Click()
   
TypingEffect "Hi! Nice chatting with you, my name is Rex.....", _
  0.15

End Sub

Private Sub TypingEffect(msg As String, time)
   
   Dim msgLen As Integer
   Dim currIndex As Integer
   Dim currChar As String
   Dim currText As String
       
   msgLen = Len(msg)
   
   Do While currIndex <= msgLen
       DoEvents
           currIndex = currIndex + 1
           currChar = Mid(msg, currIndex, 1)
           
           currText = currText & currChar
           Text1.Text = currText
           delay time
           
       DoEvents
    Loop

End Sub
[/HIDE-THANKS]

 
Status
Not open for further replies.
Back
Top