次の方法で共有


ComboBox.SelectionLength プロパティ

コンボ ボックスの編集できる部分で選択されている文字数を取得または設定します。

Public Property SelectionLength As Integer
[C#]
public int SelectionLength {get; set;}
[C++]
public: __property int get_SelectionLength();public: __property void set_SelectionLength(int);
[JScript]
public function get SelectionLength() : int;public function set SelectionLength(int);

プロパティ値

コンボ ボックス内で選択されている文字数。

例外

例外の種類 条件
ArgumentException 値が 0 未満でした。

解説

このプロパティを使用すると、選択されたテキストに対して操作を実行する前に、コンボ ボックス コントロールで文字が選択されているかどうかを判断できます。 SelectionLength プロパティの値がコントロールのテキスト内の文字数を超える値に設定されている場合、 SelectionLength プロパティの値は、コントロール内のテキストの全体の長さから SelectionStart プロパティの値を引いた値に設定されます (SelectionStart プロパティに値が指定されている場合)。

必要条件

プラットフォーム: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 ファミリ

参照

ComboBox クラス | ComboBox メンバ | System.Windows.Forms 名前空間