Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using cut, copy, paste, etc.

Status
Not open for further replies.

artyk

Programmer
Apr 5, 2006
163
US
Hi. I am very new to vb.net. I have done a moderate amount of work in vb6, but have not used some of the functions that I need to use now. I was wondering how you use cut, copy, and paste within a program. I have menus set up that have some of the common items, but I'm not sure of the code I need to get those to function properly. Also, if anyone knows of a good site to get some code snippets such as that I would be very grateful. Thanks.
 
This should give you some idea of how to get started

Code:
    Public Sub menuCut()
        If txtBox.SelectionLength > 0 Then
            txtBox.Cut()
        End If
    End Sub

    Public Sub menuCopy()
        If txtBox.SelectionLength > 0 Then
            txtBox.Copy()
        End If
    End Sub

    Public Sub menuPaste()
        txtBox.Paste()
    End Sub

Becca

Somtimes, the easy answer is the hardest to find. :)

Still under construction ...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top