ComboBox.Select(Int32, Int32) 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
在可編輯部分 ComboBox選取 .
public:
void Select(int start, int length);
public void Select(int start, int length);
override this.Select : int * int -> unit
Public Sub Select (start As Integer, length As Integer)
參數
- start
- Int32
文字框中當前文字選擇中第一個字元的位置。
- length
- Int32
要選擇的字元數量。
例外狀況
備註
如果你想把起始位置設為控制項文字的第一個字元,參數 start 設為零。 你可以用此方法選擇文字子字串,例如搜尋控制項文字並替換資訊時。
Note
SelectionStart 返回當前選擇的較低值。 例如, Select(10, -4) 選取字元位置 6 到 字元位置 10 的文字。 如果你現在取得數 SelectionStart 值,會變成6,而不是10。