Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsVB SyntaxEnterprise DevelopmentDatabase AccessControlsCOMWin APICrystal ReportDeploymentGeneralGeneral 2
Related Topics
VB.NET / ASP.NETMS SQL ServerMS AccessOther Database ProductsMore Topics ...

VB Forum / General 2 / September 2004



Tip: Looking for answers? Try searching our database.

cursor position within a textbox

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Tim Badger - 28 Sep 2004 13:08 GMT
Hi all, need some help ' cause I just can't figure this one out.  I am
trying to find which char the cursor is located at within an text box using
the arrow keys.

Thanks
TimB
Jan Hyde - 28 Sep 2004 15:21 GMT
"Tim Badger" <tbadger@adlandsys.com>'s wild thoughts were
released on Tue, 28 Sep 2004 08:08:10 -0400 bearing the
following fruit:

>Hi all, need some help ' cause I just can't figure this one out.  I am
>trying to find which char the cursor is located at within an text box using
>the arrow keys.

Take a look at SelStart and SelLength

Jan Hyde (VB MVP)

Signature

Sinuses run in our family (Richard Lederer)

[Abolish the TV License - http://www.tvlicensing.biz/]

Rick Rothstein - 28 Sep 2004 16:01 GMT
> Hi all, need some help ' cause I just can't figure this
> one out.  I am trying to find which char the cursor is
> located at within an text box using the arrow keys.

If your TextBox is named Text1, then

CharAfterCursor = Mid$(Text1.Text, Text1.SelStart + 1, 1)

The +1 is there because the SelStart property is zero-based and
character positions in a string are 1-based.

Rick - MVP
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.