|
-
Nov 11th, 2000, 05:53 PM
#1
Thread Starter
Member
I have a small project im working on and i cant seem to figure out one thing, how do i insert text AT THE CURSOR into a text box.
simple example:
lets say i have a text box that reads:
"Hello, welcome to my program!"
and the cursor is right betwteen the word Hello and the comma, and i want a button that will insert text at the cursor (such as a name in this instance).
i know it will involve breaking the text box contents into a string before the cursor point and a string after the cursor point then sticking a string in between and cancatonating it all together but i cant figure out how to get the cursor position.
any help would be appreiciated, thanks in advance'
-glitch13
-
Nov 11th, 2000, 05:57 PM
#2
transcendental analytic
Code:
'to insert text at the cursor position
text1.seltext = text1.seltext & "some text here"
'to get the cursor position
debug.print text1.selstart
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Nov 11th, 2000, 06:37 PM
#3
Thread Starter
Member
havent been able to try it yet, but even though you dont have all the text up to the cursor selected, VB still sees all the text before the cursor as selected text?
-
Nov 11th, 2000, 07:07 PM
#4
transcendental analytic
It automatically deselects if you use seltext
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Nov 11th, 2000, 07:30 PM
#5
Thread Starter
Member
sorry, i misstyped, i meant
even thought you DON'T have all of the text up to the cursor selected it still sees all of the text up to the cursor as selected text?
if you misanswered the first time, let me reiterate:
pretend that the "|" is the cursor, i want the following:
"Hello|, welcome to my program!"
to read:
"Hello John, welcome to my program"
(not the mouse cursor, the text edit cursor)
[Edited by glitch13 on 11-11-2000 at 07:33 PM]
-
Nov 11th, 2000, 08:13 PM
#6
transcendental analytic
That's exactly what it should do, go try it for yourself
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|