2009-06-22 5 views

Répondre

7

Vous pouvez le faire uniquement avec Interop natif: GetCaretPos

[DllImport("user32.dll")] 
[return: MarshalAs(UnmanagedType.Bool)] 
static extern bool GetCaretPos(out Point lpPoint); 
+0

A travaillé comme un charme. Merci! – bbqfrito

2

J'utilise la fonction TextBox.GetPositionFromCharIndex. Il donne des coordonnées par rapport au coin supérieur gauche du TextBox.

+0

La fonction semble [ne fonctionne pas parfois] (http://stackoverflow.com/q/1831219/2388257) –

Questions connexes