TextBoxBase.Cut 方法
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
從文字編輯控制項中移除目前選項,並將其複製到 Clipboard。
public:
void Cut();
C#
public void Cut ();
C#
[System.Security.SecurityCritical]
public void Cut ();
member this.Cut : unit -> unit
[<System.Security.SecurityCritical>]
member this.Cut : unit -> unit
Public Sub Cut ()
- 屬性
下列範例示範如何使用 Cut 方法來刪除 控制項中 TextBox 選取的文字。
C#
private void cutText(object sender, RoutedEventArgs e)
{
myTextBox.Cut();
}
Private Sub cutText(ByVal sender As Object, ByVal e As RoutedEventArgs)
myTextBox.Cut()
End Sub
剪下作業會從文字編輯控制項中移除目前的選取範圍,並將它 Clipboard 複製到 。 請注意,選取的文字會從進程中的文字編輯控制項中移除 (剪下) 。 類似的方法 Copy 會將目前的選取範圍複製到剪貼簿,但不會從文字編輯控制項中移除選取的文字。
產品 | 版本 |
---|---|
.NET Framework | 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8 |
Windows Desktop | 3.0, 3.1, 5, 6, 7 |