ToolStripComboBox.SelectionLength 屬性

定義

取得或設定在 ToolStripComboBox 可編輯部分中選取的字元數。Gets or sets the number of characters selected in the editable portion of the ToolStripComboBox.

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

屬性值

ToolStripComboBox中選取的字元數。The number of characters selected in the ToolStripComboBox.

屬性

備註

您可以使用這個屬性來判斷下拉式方塊控制項中目前是否已選取任何字元,然後再對選取的文字執行作業。You can use this property to determine whether any characters are currently selected in the combo box control before performing operations on the selected text. SelectionLength 屬性的值設定為大於控制項文字內字元數的值時,[SelectionLength] 屬性的值會設定為控制項內整個長度的文字減去 SelectionStart 屬性的值(如果已為 SelectionStart 屬性指定任何值的話)。When the value of the SelectionLength property is set to a value that is larger than the number of characters within the text of the control, the value of the SelectionLength property is set to the entire length of text within the control minus the value of the SelectionStart property (if any value is specified for the SelectionStart property).

適用於