C# WPF RichtextBox type behavior change -


i have converted textbox (which using search box) richtextbox in order bold contained words within box. upon doing have noticed few "errors". know if intentional, , how over-ride them.

the first, , important problem occurs call selectall() on box pull information on keydown event:

((richtextbox)sender).selectall(); string search = ((richtextbox)sender).selection.text; 

this prevents me writing more character in rtb. presume leaving text selected , overwriting every key press. cannot find deselect() method, there means of attaining string data prevent issue. need string pass regular expression.

secondly, rtb throws ibeam box on double click. there way recreate behavior of textbox enters on single click (or should entering on single click default?)

instead of selecting all, content , convert flow document plain text.

flowdocument doc =((richtextbox)sender).document; string search = new textrange(doc.contentstart, doc.contentend).text; 

convert flowdocument simple text


Comments

Popular posts from this blog

java - Oracle EBS .ClassNotFoundException: oracle.apps.fnd.formsClient.FormsLauncher.class ERROR -

c# - how to use buttonedit in devexpress gridcontrol -

nvd3.js - angularjs-nvd3-directives setting color in legend as well as in chart elements -