| |

VerySource

 Forgot password?
 Register
Search
View: 753|Reply: 5

How to get the position of the cursor in the text?

[Copy link]

1

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-1-14 13:40:01
| Show all posts |Read mode
How to get the position of the cursor in the text?
Reply

Use magic Report

0

Threads

56

Posts

21.00

Credits

Newbie

Rank: 1

Credits
21.00

 China

Post time: 2020-1-19 10:18:01
| Show all posts
mark
I want to know too
It seems to call the system DLL, but I don't know how to do it ..
Reply

Use magic Report

1

Threads

7

Posts

8.00

Credits

Newbie

Rank: 1

Credits
8.00

 Invalid IP Address

Post time: 2020-1-26 23:36:01
| Show all posts
textBox1.SelectionStart
Reply

Use magic Report

0

Threads

6

Posts

5.00

Credits

Newbie

Rank: 1

Credits
5.00

 China

Post time: 2020-1-28 21:45:01
| Show all posts
Webform or Winform?

Winform is very easy likelinyingsaid.

If you mean asp.net, use javascript below:

var dRng = document.createTextRange (). duplicate ();
var selectedText = dRng.text;
Reply

Use magic Report

1

Threads

26

Posts

14.00

Credits

Newbie

Rank: 1

Credits
14.00

 China

Post time: 2020-1-29 09:18:01
| Show all posts
using System.RunTime.Interopservice;

[DllImport ("user32.dll")]
public static extern int GetCaretPos (ref Point lpPoint);


Note the difference between the coordinates of this Point and the coordinates of the client area of ​​the program!
Reply

Use magic Report

1

Threads

26

Posts

14.00

Credits

Newbie

Rank: 1

Credits
14.00

 China

Post time: 2020-1-29 10:00:02
| Show all posts
using System.Runtime.InteropServices;
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list