I have a RichTextBox control on an application and here’s my problem: when the application runs, if I start selecting with the mouse some of the characters inside a word and continue selecting outside it, the selection automatically includes the whole word in which I begun selection and any other words from which I want to select just a part, ms word-ish, if I’m not mistaken.
e.g.:
- the text is: “Just another foobar”
- what I want to select is: “Just ano[ther foo]bar” (the thing between the [])
- what is actually selected: “Just [another foobar]”
The problem is just with mouse selecting, if I select text with the keyboard it works just fine. Also, the auto word select property of the control is turned off. Any idea why is that?
There’s a silly bug in the AutoWordSelection property implementation. The workaround is equally silly. Add a new class to your project and paste the code shown below. Compile. Drop the new control from the top of the toolbox onto your form, replacing the existing RTB.
I left an annotation at the bottom of this MSDN Library page with the details of the bug.