System.Windows.Input.InputMethod
System.Windows.Input.InputMethod の添付プロパティの挙動がよくわかんない。
<Window x:Class="WpfSample.Window1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="テキストボックスで IME の ON/OFF を指定する" SizeToContent="Height" Width="300"> <Window.Resources> <Style TargetType="TextBox"> <Setter Property="Margin" Value="5"/> </Style> <Style TargetType="Label"> <Setter Property="VerticalContentAlignment" Value="Center"/> </Style> </Window.Resources> <Grid> <Grid.ColumnDefinitions> <ColumnDefinition Width="Auto"/> <ColumnDefinition/> </Grid.ColumnDefinitions> <Grid.RowDefinitions> <RowDefinition Height="Auto"/> <RowDefinition Height="Auto"/> </Grid.RowDefinitions> <Label Content="IME ON:" Grid.Row="0"/> <TextBox InputMethod.PreferredImeState="On" Grid.Column="1" Grid.Row="0" Text="On のはず"/> <Label Content="IME OFF:" Grid.Row="1"/> <TextBox InputMethod.PreferredImeState="Off" Grid.Column="1" Grid.Row="1" Text="Off のはず"/> </Grid> </Window>
とりあえず、これで意図したとおりにうごくっぽい。
トラックバック
- このエントリーにトラックバック:
- http://frog.raindrop.jp/cgi-bin/mt/mt-tb.cgi/2377
コメント