Control the input cursor?

  • Thread starter Thread starter Rader
  • Start date Start date
R

Rader

As the textbox is focused,if I press the keys up/down arrow instead of
other keys like a,b,c......
the input cursor moves left and right.Now its the problem,I want the
cursor stay where it was(stop moving), as I press the up/down key.Can I
do that through recoding the textbox's events in c#?

I appreciate everyone can help me,thanks in advance~
 
Hello Rader,

Add KeyDown handler for your control and use this code

if (e.KeyCode == Keys.Up || e.KeyCode == Keys.Down)
{
e.Handled = true;
}

R> As the textbox is focused,if I press the keys up/down arrow instead
R> of
R> other keys like a,b,c......
R> the input cursor moves left and right.Now its the problem,I want the
R> cursor stay where it was(stop moving), as I press the up/down key.Can
R> I
R> do that through recoding the textbox's events in c#?
R> I appreciate everyone can help me,thanks in advance~


---
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche
 
Back
Top