Solved

Puting the cursor to the right

Posted on 2009-04-02
3
261 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

Title # Comments Views Activity
How to Add / Edit Windows Menu 4 74
Prevent user closing word document opened with VB6 6 84
MsgBox 4 71
Dinamic report to Crosstab query 9 51
Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…

749 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