c# - Get last entered word of RichEditControl -


How do I get my code last entered in the rich edit control

  private zero Rich EditControl1_KeyPress (Object Sender, Keypress Event Eggs E) {If (E.Kerk == '') {Int verandpanzi = rich edit control 1. Document. Caretation .OIT (); Int currentPosition = wordEndPosition; While (current position> 0 & amp; amp; amp; amp; and & amp; amp; amp; amp; & amp; amp; Advanced Editing Controls> text [currentPosition - 1]! = '') {CurrentPosition--; } String word = rich edit control1 Lesson Thabstring (current condition, word nutrition - current state); this. Text = "last four was typed:" + word; }}   

But when I create a new line , then it was wrong.

I think that you want to get a word, whether it's surrounded by spaces or new lines Yes, until this is the last? You should probably check the new line in your loop, so it does not check the blank space only. richEditControl1.Text [currentPosition - 1]! = "\ n"

Or something is not evenly sure that "\ n" will pass, because I have not worked with such examples for some time. It probably just did not know what to do with the particle New Line.

Comments

Popular posts from this blog

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -