Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

How to set caret position in a textbox

Posted on 2003-03-19
6
Medium Priority
?
1,680 Views
Last Modified: 2012-06-27
I need to move the caret horizontally and vertically hin a regular MS textbox. Code appreciated, extremely urgent.
0
Comment
Question by:mccainz2
6 Comments
 
LVL 2

Expert Comment

by:Jacamar
ID: 8170871
Please explain a little more.
0
 
LVL 4

Accepted Solution

by:
TigerZhao earned 2000 total points
ID: 8170934
TextBox will automatic set caret position when redraw window, Is property .SelStart not [conform with your need?
0
 
LVL 3

Expert Comment

by:DocM
ID: 8170956
Hi,
Change the selstart property to move the caret.
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 5

Author Comment

by:mccainz2
ID: 8170962
Im emulating a vt100 terminal with a textbox, dug into the WINAPI book at my desk and found caret functions

Private Declare Function CreateCaret Lib "user32" (ByVal hwnd As Long, ByVal hBitmap As Long, ByVal nWidth As Long, ByVal nHeight As Long) As Long
Private Declare Function DestroyCaret Lib "user32" () As Long
Private Declare Function SetCaretBlinkTime Lib "user32" (ByVal wMSeconds As Long) As Long
Private Declare Function SetCaretPos Lib "user32" (ByVal x As Long, ByVal y As Long) As Long
Private Declare Function ShowCaret Lib "user32" (ByVal hwnd As Long) As Long
Private Declare Function HideCaret Lib "user32" (ByVal hwnd As Long) As Long
0
 
LVL 5

Author Comment

by:mccainz2
ID: 8170966
Im investigating selstart, that may work......Simple is always better....
0
 
LVL 5

Author Comment

by:mccainz2
ID: 8170989
yup, I was making it way too difficult, selstart and sellength will get me all the way home.
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

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

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses
Course of the Month14 days, 1 hour left to enroll

580 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