+ Post New Thread
Results 1 to 4 of 4
Coding Thread, how to set cursor in textbox in Coding and Web Development; Hi, Im strugling with an old hat problem with multiline textboxes, im programming in VBA and i want to create ...
  1. #1
    tinmanjo's Avatar
    Join Date
    Mar 2010
    Posts
    16
    Thank Post
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    how to set cursor in textbox

    Hi,

    Im strugling with an old hat problem with multiline textboxes, im programming in VBA and i want to create an emulated console for doing script like querying, however ive tried:-

    text1.text=text1.text & vbcrlf & ">"
    text1.selstart=len(text1.text)

    but the damn cursor moves to the next line after the ">" eve though i havent made an extra carriage return, any ideas why this is happening?

  2. #2

    AngryTechnician's Avatar
    Join Date
    Oct 2008
    Posts
    3,730
    Thank Post
    698
    Thanked 1,212 Times in 761 Posts
    Rep Power
    395
    Have you tried text1.selstart=len(text1.text) - 1

  3. #3
    tinmanjo's Avatar
    Join Date
    Mar 2010
    Posts
    16
    Thank Post
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    Quote Originally Posted by AngryTechnician View Post
    Have you tried text1.selstart=len(text1.text) - 1
    Yes Ive tried -1,-2 ,3 gives error, im not sure if somehow the textbox changes focus after the change of Vbcrlf. the cursor suddenly jumps and creates a CR when i haven't added one.

  4. #4
    tinmanjo's Avatar
    Join Date
    Mar 2010
    Posts
    16
    Thank Post
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    Ah damnit, i just realised the default enter key setting was set to create new line.

    solved.



SHARE:
+ Post New Thread

Similar Threads

  1. Flashing Cursor
    By jack0w in forum Windows
    Replies: 10
    Last Post: 21st June 2011, 10:29 PM
  2. Cursor Snap Back in Windows 7
    By SJL_2010 in forum Windows 7
    Replies: 3
    Last Post: 8th February 2010, 10:07 PM
  3. Cursor jumping in text boxes
    By zag in forum Windows 7
    Replies: 0
    Last Post: 9th September 2009, 11:00 AM
  4. Touch Pad cursor speed resetting.
    By park_bench in forum Windows
    Replies: 6
    Last Post: 1st June 2009, 08:34 PM
  5. [For Sale] Promethean 32 set Activote Set (Brand New)
    By lgfl_it_guy in forum Classified Adverts
    Replies: 20
    Last Post: 8th February 2009, 12:41 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •