通过


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)的值,以编程方式移动文本框内的插入点。 文本框必须具有焦点才能移动插入符号。

适用于