共用方式為


ToolStripTextBox.SelectionStart 屬性

定義

取得或設定在 ToolStripTextBox中選取的文字起始點。

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

屬性值

在 中選取 ToolStripTextBox的文字起始位置。

屬性

備註

若控制項中未選取文字,此特性會指示新文字的插入點。 如果你將此屬性設定在控制項文字長度之外的位置,選取起始位置會放在最後一個字元之後。 當文字框控制項中選取文字時,更改此屬性可能會降低屬性 SelectionLength 的值。 若控制項中在屬性所示 SelectionStart 位置後剩餘的文字小於屬性 SelectionLength 值,屬性 SelectionLength 值會自動減少。 房產價值 SelectionStart 從不會導致房產的增值 SelectionLength

備註

你可以透過程式化地在文字框內移動插入點,方法是將 設定 SelectionStart 為你想讓插入點移動的位置,並將屬性設 SelectionLength 為零(0)。 文字框必須有焦點,才能讓插入點被移動。

適用於