< Windows XP に IPv6 を追加する | Visual Studio 2008 で、XAML デザイナを開くと異常終了する >

May 12, 2009

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

コメント

コメントする

※ コメントスパム対策のため、コメント本文はおはよう、こんにちわ、こんばんわのいずれかより始めるようにしてください。

name:
email:

※ 必要ですが、表示しません。

url:
情報を保存する ?