Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
515
Trouble using UltraSpellChecker with UltraFormattedTextEditor
posted

Hello,

I'm having trouble using the UltraSpellChecker with an UltraFormattedTextEditor control when the text of the control has multiple lines. 

I want to use the ContextMenu option and have the user select from the list of suggestions.  I am using NetAdvantage version 7.2 with Visual Studio 2005.  I modified the "Simple Spell Checking VB" sample, which is included.  The problem seems to be with UltraSpellChecker.GetErrorAtPoint().  When you right-click on an error in the first line, everything is fine.  But when you right-click on an error in any other line, the UltraWinSpellChecker.StartIndex that's returned from GetErrorAtPoint() is off by one character.  If you try it with three lines, it will be off by two characters.  This makes is impossible to replace the mispelling with the suggestion.

It looks like it's counting the carriage return-newline as two characters, rather than one.  The funny thing is that the red squiggly line is displayed correctly for the error (see SimpleSpellChecking.jpg in attached project).  But if you step through the code, you'll see that the StartIndex for the error is not correct (see Watch.jpg in attached project).

This seems like a bug, but I wanted to make sure I'm doing everything correctly, which is why I attached, the modified sample project.

Can someone please help with this?  If you need any further info just let me know.

Thanks,

Sean.

SimpleSpellChecking VB.zip