vb中的剪切代码

2024-11-16 23:25:25
推荐回答(3个)
回答1:

朋友 5分啊 是不是太少了点啊

Private Sub 复制_Click()
Clipboard.Clear
If TypeOf Screen.ActiveControl Is TextBox Then
Clipboard.SetText Screen.ActiveControl.SelText
End If
End Sub

Private Sub 粘贴_Click()
If TypeOf Screen.ActiveControl Is TextBox Then
Screen.ActiveControl.SelText = Clipboard.GetText()
End If
End Sub

Private Sub 剪切_Click()
复制_Click
If TypeOf Screen.ActiveControl Is TextBox Then
Screen.ActiveControl.SelText = ""
End If
End Sub

回答2:

Private Sub 剪切_Click()
复制_Click
If TypeOf Screen.ActiveControl Is TextBox Then
Screen.ActiveControl.SelText = ""
End If
End Sub

回答3:

是呀,5分太少了。一楼的还是写了出来