ITextRange.MoveEnd(TextRangeUnit, Int32) 方法

定義

移動文字範圍的結束位置。

public:
 int MoveEnd(TextRangeUnit unit, int count);
int MoveEnd(TextRangeUnit const& unit, int const& count);
public int MoveEnd(TextRangeUnit unit, int count);
function moveEnd(unit, count)
Public Function MoveEnd (unit As TextRangeUnit, count As Integer) As Integer

參數

unit
TextRangeUnit

移動文字範圍結束位置的單位。 預設值為 Character

count
Int32

int

要移動文字範圍結束位置的 單位數目。 預設值為 1。 如果 count 大於零,則結束位置會往前移動,接近本文結尾。 如果 count 小於零,結束位置會向後移動,向本文開頭移動。 如果 count 為零,則結束位置不會移動。

傳回

Int32

int

文字範圍移動結束位置的實際 單位數目。

備註

如果您移動文字範圍的結束位置,使其位於原始開始位置之前,這個方法會將開始位置設定為等於新的結束位置;也就是說,文字範圍會變成 (插入點) 變質的範圍。

此方法會以邏輯方向移動結束位置,而不是實體方向。 也就是說,移動是在劇本的結尾或開始。 視語言而定,將結束位置移至本文結尾可能會導致結束位置向左或向右移動。

如需詳細資訊,請參閱 ITextRange 中的討論和 ITextRange.Move的一節。

適用於

另請參閱