If I add an UltraSpellChecker to a RichTextBox, whenever I type into that box, the text flickers horribly. Any underline spelling errors also flicker. Is there any way to prevent this? I'm using 10.3.2067.
Hello jcwild,
I try to reproduce your scenarion and issue in a small sample, but without success. Could you please take a look at the attached sample and if you think that I didn`t reproduce your scenario, please feel free to modify this sample to reproduce your issue and revert it back to me. I`ll be glad to research it for you.
Regard
Sorry, I should have been more specific. If you change the SpellChecker Mode to AsYouType you should see the flickering. I verified this in your sample. It might be more obvious if you increase the font size.For some reason, the flickering seems to be worst on the top row.
Hello Campbell ,
I try to reproduce your issue, but without success. Could you please tell me what is your version (Are you using version 10.3 or your trial version 12.2) Are you able to upload small sample that reproduce your issue.
Thanks and Regards
Both problems occur in both versions. I have attached a sample to demonstrate both issues.
The SelectionStart problem is a real pain. All I want to be able to do is know the location within the text that the cursor is.
I can do this if WordWrap is False using the following:
EditInfo.SelectionStart + Math.Max(EditInfo.GetLineNumber(EditInfo.SelectionStart) - 1, 0)
However, if I have WordWrap turned on then I need to know how many carriage returns there are before the cursor. The quickest method I found was to create a second, hidden FormattedTextEditor with WordWrap false, copy the text over, and run the above on it, but what a waste of resources...
Secondly, the spell check underlines on the FormattedTextEditor appear in a different place (higher up) than the RichTextBox (see attached image). Is there any way I can change this so the underline is actually under the text, rather than covering up the bottom of the text? As it is currently, it's more of a strikethrough than an underline.
I get the feeling this control is not heavily used, as others would have found these problems.
Thanks,Campbell
Hi Campbell,
I've been looking into the SelectionStart issue you reported here and I need some more information.
SelectionStart doesn't really match up to the Text property of the control due to the way some internal implementation details are handled in terms of how the Value is translated into text and the UIElements are created. And this isn't something we can change without causing (or at least potentially causing) some very serious breakage.
So what I would like to try to do is find you a solution either using the existing code or maybe exposing a new property on method on the control that gives you what you need. Currently, I can find no way to translate the SelectionStart into a position that has any reliable meaning related to the Text property on the control.
We might be able to expose a property or a method the performs a sort've conversion, but before I do that, I want to make sure I understand what you are doing here. What, exactly, are you using the SelectionStart for? Are you trying to examine text around this position? Either way, what, exactly, are you doing with that information. You mentioned a context menu - is that what this is for? If so, why can't you use the SelectedText property? Is this only for the case where SelectionLength is 0?
Hi Mike,
Thanks for looking into this.
For the main part, yes, it is to identify the word clicked on by the mouse, or to identify characters around the cursor (I have created an intellisense feature, much like Visual Studio editor has), and that is typically with SelectionLength = 0. I also use it to move the cursor to the end of text which I'd normally do by setting SelectionStart to TextLength.
I appreciate that it would be a major breaking change to change this, but aren't you going to have to face that at some point anyway? Would it not be better to correct the properties, then add additional ones such as SelectionStartLegacy that returns what SelectionStart does currently, that you can phase out after a certain number of releases?
That said, as far as I'm concerned, another property that returns SelectionStart with respect to Text would be fine for me. I am actually subclassing the control and have my own SelectionStart (was easier, since I was swapping out a RichTextBox), and so I'm doing the conversion in there. I've found the quickest way to do this is to create a second hidden FormattedTextEditor (fte) with WordWrap = False, then return
EditInfo.SelectionStart + Math.Max(fte.EditInfo.GetLineNumber(EditInfo.SelectionStart) - 1, 0)
So basically I am just adding one character for every carriage return before the cursor to make up for the single character carriage returns. If you can give me a property that returns the same as GetLineNumber with WordWrap = False when WordWrapping is True, then that would also be sufficient for my purposes.
Fantastic Mike, thanks very much! :)
Hi,
Just FYI - We are going to add a new method to EditInfo called GetSubstring, which is basically like the Substring method on System.String. So you will be able to pass in the SelectionStart as the StartIndex and get the text. It should be in the service release later this month (December 2012).
Regarding the borders and theming, you have to turn off themes in order to change the borders. Windows Themes are all or nothing. You can't change a color or part of the themed element.
But... you can turn off themes selectively on the Appearance instead of on the whole control by setting the Appearance.ThemedElementAlpha to Transparent.
Appearances are resolved up the chain, though. So if you set the control.Appearance.ThemedElementAlpha to Transparent, this will affect he whole control including the ScrollBars. So you will have to do something like this:
this.ultraFormattedTextEditor1.Appearance.ThemedElementAlpha = Infragistics.Win.Alpha.Transparent;this.ultraFormattedTextEditor1.ScrollBarLook.Appearance.ThemedElementAlpha = Infragistics.Win.Alpha.Opaque;
Also, should it be possible to set BorderStyle to None without having to set UseOsThemes = False? I want to remove the border, but retain the nice scrollbars. (This is because I am placing the control inside a tab control and don't want doubled up borders).