Cut
, Copy
, Paste
and Delete
of texts routines in Visual Basic? Well, settle down now. This source codes shows the CUT, COPY, PASTE and DELETE routines using the Clipboard object. This source codes assumes that you have four commandbutton controls (EditCut, EditCopy, EditPaste and EditDelete) in your Visual Basic project
Private Sub EditCut_Click()
'Clear the contents of the Clipboard.
Clipboard.Clear
'Copy selected text to Clipboard.
Clipboard.SetText Screen.ActiveControl.SelText
'Delete selected text.
Screen.ActiveControl.SelText = ""
End Sub
Private Sub EditCopy_Click()
'Clear the contents of the Clipboard.
Clipboard.Clear
'Copy selected text to Clipboard.
Clipboard.SetText Screen.ActiveControl.SelText
End Sub
Private Sub EditPaste_Click()
'Place text from Clipboard into active control.
Screen.ActiveControl.SelText = Clipboard.GetText()
End Sub
Private Sub EditDelete_Click()
'Delete selected text.
Screen.ActiveControl.SelText = ""
End Sub
0 comments:
Post a Comment