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.
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Kirtan PatelPosted Oct 27, 2009, 11:34 PM
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 :)
naura paxPosted Oct 28, 2009, 2:16 AM
That was really helpful.
manohar vakkalaPosted Oct 27, 2009, 3:05 AM