TextSelection.Cut 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
将选定文本复制到剪贴板并将其从原始位置删除。
public:
void Cut();
public:
void Cut();
void Cut();
[System.Runtime.InteropServices.DispId(21)]
public void Cut ();
[<System.Runtime.InteropServices.DispId(21)>]
abstract member Cut : unit -> unit
Public Sub Cut ()
- 属性
示例
Public objSel As TextSelection = DTE.ActiveDocument.Selection
Sub CutExample()
' Before running this example, open a text document.
' Perform operations on the text.
objSel.StartOfDocument(False)
Position(vsStartOfLineOptions.vsStartOfLineOptionsFirstColumn, 4)
objSel.Copy()
Position(vsStartOfLineOptions.vsStartOfLineOptionsFirstText, 4)
objSel.Cut()
Position(vsStartOfLineOptions.vsStartOfLineOptionsFirstText, 4)
objSel.Delete()
Position(vsStartOfLineOptions.vsStartOfLineOptionsFirstText, 4)
objSel.DeleteLeft(6)
objSel.DestructiveInsert("NEW TEXT")
End Sub
Sub Position(ByVal pos As vsStartOfLineOptions, ByVal ipos As Integer)
' Moves the insertion point down to the beginning of the next line,
' and then highlights the right-most four characters.
objSel.LineDown()
objSel.StartOfLine(vsStartOfLineOptions.vsStartOfLineOptionsFirstText)
objSel.CharRight(True, 4)
End Sub