LoginSignup
0
1

More than 5 years have passed since last update.

Visual Studio / WPF > 08 TextBox和PasswordBox > TextBox > MaxLengthプロパティ > 入力時:長さ制限がかかる | Csharp script: 長さ制限がかからない

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

https://www.youtube.com/watch?v=SBeDgl7CX6E&list=PLaYqF7AnyNPfTfZiGqTwedIKW_FkZv4Xj&index=8
3:50あたり

TextBoxのMaxLengthプロパティの例が紹介されている。
MaxLengthプロパティを使うと、入力時にテキストの長さに制限がかかるようだ。

一方で、以下のようなコードでTextBoxの中身を代入する場合には、長さ制限がかからないようだ。

T_pass1.Text = "3.141592";

入力時 (長さ制限あり MaxLength=5)
work.png

C# scriptでの代入時 (長さ制限なし)
work.png

0
1
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
1