ComboBox.SelectionLength 屬性

定義

取得或設定在下拉式方塊可編輯部分中選取的字元數。

public:
 property int SelectionLength { int get(); void set(int value); };
[System.ComponentModel.Browsable(false)]
public int SelectionLength { get; set; }
[<System.ComponentModel.Browsable(false)>]
member this.SelectionLength : int with get, set
Public Property SelectionLength As Integer

屬性值

下拉式方塊中所選取的字元數。

屬性

例外狀況

值小於零。

備註

您可以使用這個屬性來判斷下拉式方塊控制項中目前是否選取任何字元,然後再對選取的文字執行作業。 當屬性的值 SelectionLength 設定為大於控制項文字中字元數的值時,屬性的值 SelectionLength 會設定為控制項內的整個文字長度減去 SelectionStart 屬性的值, (如果為屬性指定任何值 SelectionStart ,則為屬性) 。

適用於