0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Visual Studio / WPF > 08 TextBox和PasswordBox > TextBox > IsReadOnly | TextWrapping プロパティ

Last updated at Posted at 2017-05-08
動作環境
Windows 7 Pro (32bit)
Microsoft Visual Studio 2017 Community
Sublime Text 2

TextBoxのプロパティとしてIsReadOnlyとTextWrappingを使った例が紹介されている。

試したみた。

MainWindow.xaml
<Window x:Class="_170509_t0640_TextBox.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:_170509_t0640_TextBox"
        mc:Ignorable="d"
        Title="MainWindow" Height="350" Width="525">
    <Grid>
        <TextBox x:Name="T_memo" HorizontalAlignment="Left" Height="142" Margin="35,28,0,0" TextWrapping="Wrap" Text="J'ai étudié le français pendant huit ans, mais Je e ne peux pas parler français bien maintenant. Tant pis." VerticalAlignment="Top" Width="272" IsReadOnly="True"/>

    </Grid>
</Window>

MainWindow.xaml.cs側のコードは追加実装なし。

work.png

TextBoxのTextにはアクサンテギュなども普通に使えるようだ。

IsReadOnly という名前のプロパティはメソッド名のようにも見えてしまう。
IsTextWrappedでなくTextWrappingという命名にも違和感はある。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?