Solved

Puting the cursor to the right

Posted on 2009-04-02
3
260 Views
Last Modified: 2012-05-06
How to Put the cursor to the right side of the text box upon executing the setfocus?
example i have a text box name text1.text then a command button name cmd1.
my code goes like this;

Private Sub cmd1_Click()
Text1.SetFocus
End Sub

i want the cursor to position right side of the text1.text



sample.bmp
0
Comment
Question by:Whing Dela Cruz
  • 2
3 Comments
 
LVL 11

Accepted Solution

by:
Antagony1960 earned 500 total points
ID: 24050718
Private Sub cmd1_Click()
Text1.SelStart = Len(Text1.Text)
Text1.SetFocus
End Sub
0
 

Author Closing Comment

by:Whing Dela Cruz
ID: 31565822
Thanks to you,
the code is working...
More Power!
0
 
LVL 11

Expert Comment

by:Antagony1960
ID: 24050805
Glad to have helped! :-)
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

790 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question