How to go to the start and end of a string
Firstly, to start off, open up Visual Basic 6.0.
When you've done that, it should prompt you with a dialog box asking you what type of project you want to make. Choose Standard EXE and press open.
Once you have done that, you should have something that looks like this:
Now we are going to set up the design of the application. To do this we are going to need two command buttons and one textbox.
So go over to your toolbox (the thing that says "General" and has lots of little icons), and select the command button (the one circled in red in the picture below) and create two of them on the form. Then select the textbox (the ne circled in green) and create one of them on the form.


Once that is done, we need to change the names of the objects and the text that they say.
So click on the first command button (Command1) and go over to the right hand side where you should see something like this:
Now go to the caption area (the one that is highlighted on the picture) and double click "command1" and change it to "Go to start ." Now go up to the bit that says Name (it should be the very first one) and change that to "cmd_start" which is the proper way to name a command button. When this is done, do the same thing for the other command button, except the caption should be "Go to end " andthe name, "cmd_end."
Now we need to do the same for the textbox. But this time, instead of Caption, there is something different. This is Text. The text property is what you want the text to be displayed as. You can change this in the code aswell as when you run your application (unless you have it locked). So change the text to whatever you want. Now change the Name property to "txt_sae" or something similar.
Now for the coding!
Double click on the command button that says "Go to start ." It should take you to a blank screen that says:
Private Sub cmd_start_Click()
End Sub
In the middle of this, insert this code
txt_write.SelStart = 0
You should now have this code
Private Sub cmd_uppercase_Click()
txt_write.SelStart = 0
End Sub
What this is telling the application to do is, when you press the command button for making it go to the start, it is saying, "if you selected all the text, and then went before the very first character (which would be 0) you would end up at the start. If you cahnged the "0" in the code, to say, 18 then it would go to the 18th character in the string.
The next peice of code is the code for the "go to end" button. This is a little different because you don't know how long the string is. You can't just have a button that says go to end and you have it going to the 18th character because you think that that is all the user is going to write. So instead we use the "len" function. Here is the code.
Private Sub cmd_end_Click()
txt_write.SelStart = Len(txt_write.Text)
End Sub
What this is telling the application to do is basically the same as the "go to start" button. Except we're using len(). Len() returns the length of a string. You use it by typing Len(yourtextbox.text) or you can use it to get the length of a label or commandbutton. e.g Len(cmd_start.caption).
So in this case, we're telling it to get the entire length of the string. So it gets that and places the cursor there.
Now press F5. This will run your application. Alternitivly you can press this button (the one highlighted in blue):
You should be able too, now, when your application is running, be able to press one button and it puts the cursor position at the start of a string. And then press another button and it place it at the end of a string.
When you are done with your application, exit out of it and save.