Auto Typing Application in VB.NET

Typing means to encode or write. It is really a hassle when we always encode or type such long sentences and paragraphs. But now, i will introduce some kind of tutorial in visual basic.net; the Auto Typing Application. Now, let's start this tutorial! 1. Let's start with creating a Windows Form Application for this tutorial by following the following steps in Microsoft Visual Studio: Go to File, click New Project, and choose Windows Application. 2. Next, add a Label named Label1, a Button named Button1 and labeled "Start Typing", and lastly add a Timer named Timer1. You must design your layout like this: design 3. In your code module, initialize this as your Global Variable:
  1.     Public str_ As String
  2.     Public count_ As Integer
4. Next, we will code for our Timer1. Type this code in your Timer1_Tick:
  1.  If Label1.Text.Length = str_.Length Then
  2.             Timer1.Enabled = False
  3.             Exit Sub
  4.         End If
  5.         Label1.Text = str_.Substring(0, count_)
  6.         count_ = count_ + 1
Our timer will be our basis for the auto typing. If Label1.Text.Length is equal str_.Length means that if the text in Label1 is completely displayed its text, then the timer will stop ticking. The
  1. Label1.Text = str_.Substring(0, count_)
  2.         count_ = count_ + 1
means that in every 1 ms tick of the Timer it will display the desired text in Label1. 5. Lastly, code for Button1:
  1.  Private Sub Button1_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Button1.Click
  2.         Label1.Text = ""
  3.         count_ = 1
  4.         str_ = "Hello :) This is Lyndon R. Bermoy of Sourcecodester!"
  5.         Timer1.Enabled = True
  6.     End Sub
  7. End Class
When button1 is clicked the label will started to be in "blank" and count length will be equal to 1. The string to be displayed "Hello :) This is Lyndon R. Bermoy of Sourcecodester!" and the timer will start. When the timer start, the substring will be incremented by one so that it will have an automatic typing of the every single character. Testing: Click Button1. test

Output:

output Download the source code below and try it! :) For more inquiries and need programmer for your thesis systems in any kind of programming languages, just contact my number below. Best Regards,

Engr. Lyndon R. Bermoy
IT Instructor/System Developer/Android Developer
Mobile: 09079373999
Telephone: 826-9296
E-mail:[email protected]

Visit and like my page on Facebook at: Bermz ISware Solutions

Subscribe at my YouTube Channel at: SerBermz

Add new comment