Backspace Button in VB 6.0

Hi. This is my another tutorial again in vb 6.0 entitled creating a backspace button. I had already created a tutorial on this in vb.net but it has a different code. Now, let's start this tutorial! 1. Let's start this tutorial by following the following steps in Microsoft Visual Basic 6.0: Open Microsoft Visual Basic 6.0, click Choose Standard EXE, and click Open. 2. Next, add only one Button named Command1 and labeled it as "Backspace", and one TextBox named Text1 for us to have an inputted string. You must design your interface like this: design 3. Now put this code for your code module. This code is for Button1_Click as our Backspace Button:
  1. Private Sub Command1_Click()
  2.            
  3.               Text1.SetFocus
  4.              'PUT THE CURSOR AT THE END OF THE TEXT
  5.               Text1.SelStart = Len(Text1.Text)
  6.             'SEND THE KEY
  7.             SendKeys ("{BACKSPACE}")
  8. End Sub
Text1.SetFocus - The cursor will focus to the Textbox. Text1.SelStart = Len(Text1.Text) - Puts the cursor at the end of the inputted text. SendKeys ("{BACKSPACE}") - Calls or sends the function of the Backspace Key. SendKeys Method - Sends one or more keystrokes to the active window (as if typed on the keyboard).

Output:

Type any text in the TextBox and click the Backspace Button. output output Download the source code 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 Bermoy IT Instructor/System Developer/Android Developer/Freelance Programmer Mobile: 09488225971 Landline: 826-9296 E-mail:[email protected] Add and Follow me on Facebook: https://www.facebook.com/donzzsky Visit and like my page on Facebook at: https://www.facebook.com/BermzISware

Comments

You can use this button when creating a standard calculator that backspaces the number you've inputted. You can also use this button in creating a virtual keyboard.

Add new comment