WPF SpellCheck

    xiaoxiao2021-03-26  9

    <Window x:Class="SpellCheckDemo.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:local="clr-namespace:SpellCheckDemo" xmlns:sys="clr-namespace:System;assembly=System" mc:Ignorable="d" Title="MainWindow" Height="350" Width="525"> <Grid> <StackPanel> <TextBox Language="en-us" Text="Finallly, my name, kanask, is not marked as misspelled." SpellCheck.IsEnabled="True" Width="500" Height="100" VerticalAlignment="Center"> <SpellCheck.CustomDictionaries> <sys:Uri>pack://application:,,,/MsWord.lex</sys:Uri> </SpellCheck.CustomDictionaries> </TextBox> </StackPanel> </Grid> </Window>

    要点:如果不设置Language=“en-us” 红色的波浪线就不出来!!!

    当然SpellCheck.IsEnabled="True" 也不能缺少。 可以自定义字典,当出现在自定义的字典里面的字符串,就不会识别为拼写错误的单词。

    转载请注明原文地址: https://ju.6miu.com/read-450343.html

    最新回复(0)