ToolStripComboBox.SelectionStart 屬性


取得或設定 ToolStripComboBox 中所選文字的起始索引。Gets or sets the starting index of text selected in the ToolStripComboBox.

 property int SelectionStart { int get(); void set(int value); };
public int SelectionStart { get; set; }
member this.SelectionStart : int with get, set
Public Property SelectionStart As Integer


在目前文字選取的字串中第一個字元之以零為起始的索引。The zero-based index of the first character in the string of the current text selection.



如果在控制項中未選取任何文字,則此屬性會指出新文字的插入點。If no text is selected in the control, this property indicates the insertion point for new text. 如果您將此屬性設定為超出控制項文字長度的位置,則選取範圍開始位置會放在最後一個字元之後。If you set this property to a location beyond the length of the text in the control, the selection start position is placed after the last character. 在文字方塊控制項中選取文字時,變更此屬性可以釋放 SelectionLength 屬性的值。When text is selected in the text box control, changing this property can release the value of the SelectionLength property. 如果控制項中的其餘文字在 [SelectionStart] 屬性所指示的位置小於 [SelectionLength] 屬性的值,則 [SelectionLength] 屬性的值會自動減少。If the remaining text in the control after the position indicated by the SelectionStart property is less than the value of the SelectionLength property, the value of the SelectionLength property is automatically decreased. SelectionStart 屬性的值永遠不會導致 SelectionLength 屬性增加。The value of the SelectionStart property never causes an increase in the SelectionLength property.