|
-
Dec 20th, 2024, 02:42 AM
#1
Re: Prevent Mouse from changing caret location in Textbox.
Set the SelStart property to Len(Text1.Text) before adding more text with SelText.
-
Dec 20th, 2024, 03:03 AM
#2
Thread Starter
PowerPoster
Re: Prevent Mouse from changing caret location in Textbox.
 Originally Posted by Eduardo-
Set the SelStart property to Len(Text1.Text) before adding more text with SelText.
I can't do that because sometimes the typing starts in the middle.
For example I'm framing something like this:
Code:
*********************************************** ' <- This border
The Extraordinary Tale of Sterling Soupforkinöv ' <- This is slowtyped in *after* the borders are created.
*********************************************** ' <- and this border are typed into the textbox first.
That's just one example. I have stuff like this all over the place. Trying to save the position of every bit of text the program is adding so I can restore the position if the user moves it will be a nightmare.
Last edited by cafeenman; Dec 20th, 2024 at 03:08 AM.
-
Dec 20th, 2024, 01:04 PM
#3
Re: Prevent Mouse from changing caret location in Textbox.
Because no one seems to be paying attention...
 Originally Posted by cafeenman
I can't do that because sometimes the typing starts in the middle.
For example I'm framing something like this:
Code:
*********************************************** ' <- This border
The Extraordinary Tale of Sterling Soupforkinöv ' <- This is slowtyped in *after* the borders are created.
*********************************************** ' <- and this border are typed into the textbox first.
The new text isn't always at the end...
-tg
-
Dec 20th, 2024, 01:18 PM
#4
Re: Prevent Mouse from changing caret location in Textbox.
 Originally Posted by techgnome
The new text isn't always at the end...
Then, if it's not the user, what's determining where it is?
And, as I stated before, keep track of your own SelStart, and set it whenever you add new text.
Any software I post in these forums written by me is provided "AS IS" without warranty of any kind, expressed or implied, and permission is hereby granted, free of charge and without restriction, to any person obtaining a copy. To all, peace and happiness.
-
Dec 20th, 2024, 01:38 PM
#5
Re: Prevent Mouse from changing caret location in Textbox.
 Originally Posted by cafeenman
That's just one example. I have stuff like this all over the place. Trying to save the position of every bit of text the program is adding so I can restore the position if the user moves it will be a nightmare.
Then make an UserControl and encapsulate all that functionality in one place.
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
|