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.
Thanks for attached video. I saw the mentioned behavior. Please give us a time for research....
Thanks
The mentioned issue is cause from RichTextBox. Please replace your RichTextBox with UltraFormattedTextEditor and everything will works properly.
Please let me know if you have any questions.
Regrads
Thanks, that certainly resolves the flickering problem, although it is by no means a simple swap over.One thing I have noticed with the UltraFormattedTextEditor, is if you have a context menu set on the text editor, and you right-click somewhere in the editor, the BeforeToolDropdown event for the context menu fires before the EditStateChanged event on the editor. So if you build the context menu dynamically based upon the position in the editor (as I am doing, to work out what text is under the cursor) then the context menu picks up the old position, rather than the new.Is this a known bug?
Thanks,Campbell
What is also very odd about the editor, is that it reports the character position in a strange way if you have carriage returns in the text. So say you have the following text: ONE TWOTHREE FOURFIVE SIXIf you put your cursor after the FOUR, EditInfo.SelectionStart will return 18. However, that is actually position 19. If you put your cursor after the SIX, EditInfo.SelectionStart will return 27, however that is actually position 29.In other words, it reports the position of the character as though CrLf was a single character. But the Text string returned by the control has the CrLf characters as 2 characters in length.This becomes a problem when you use SelectionStart to identify where in Text you should be looking, and it is actually offset by a certain number of characters.
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
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).
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.
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?