hi experts,
I want to know whether it is possible to capture position of cursor within textbox on keypress event in window forms application in .net 2.0, if yes then how?
Thanks in advance.
Cursor position in keypress event.
3 Answers
Know the answer? Post it. Somebody with the same question will find it here.


Kirtan PatelRank #292 · 8.6K reputationPosted Oct 27, 2009, 7:34 PM EDT
you can get Cursor Postion in TextBox in KeyPress Event
using
following Code
private void textBox1_KeyPress(object sender, KeyPressEventArgs e)
{
//show cursor position in Label
label1.Text = textBox1.SelectionStart.ToString();
}
check "Do you like this answer" if it helps you :)
manohar vakkala66 reputationPosted Oct 26, 2009, 11:05 PM EDT
naura paxRank #2,843 · 502 reputationPosted Oct 27, 2009, 10:16 PM EDT
That was really helpful.