private NativeMethods.CHARFORMAT2 GetCharFormat() { NativeMethods.CHARFORMAT2 cf = new NativeMethods.CHARFORMAT2(); cf.cbSize = Marshal.SizeOf(cf); int result = NativeMethods.SendMessage(base.Handle, NativeMethods.EM_GETCHARFORMAT, NativeMethods.SCF_SELECTION, ref cf); return(cf); }
private void SpellChecker_MisspelledWord(object sender, NetSpell.SpellChecker.SpellingEventArgs args) { TraceWriter.TraceVerbose("Misspelled Word:{0}", args.Word); int selectionStart = base.SelectionStart; int selectionLength = base.SelectionLength; base.Select(args.TextIndex, args.Word.Length); NativeMethods.CHARFORMAT2 cf = new NativeMethods.CHARFORMAT2(); cf.cbSize = Marshal.SizeOf(cf); cf.dwMask = NativeMethods.CFM_UNDERLINETYPE; cf.bUnderlineType = (byte)this.MisspelledStyle; cf.bUnderlineType |= (byte)this.MisspelledColor; int result = NativeMethods.SendMessage(base.Handle, NativeMethods.EM_SETCHARFORMAT, NativeMethods.SCF_SELECTION | NativeMethods.SCF_WORD, ref cf); base.Select(selectionStart, selectionLength); }
private NativeMethods.CHARFORMAT2 GetCharFormat() { NativeMethods.CHARFORMAT2 cf = new NativeMethods.CHARFORMAT2(); cf.cbSize = Marshal.SizeOf(cf); int result = NativeMethods.SendMessage(base.Handle, NativeMethods.EM_GETCHARFORMAT, NativeMethods.SCF_SELECTION, ref cf); return cf; }