Link to home
Start Free TrialLog in
Avatar of paullepa
paullepa

asked on

Copy / Paste in Visual Studio (VB.NET) looses the 'connected' evetns

I am trying to move some of my objects into a tab.  When I cut and then paste the object - the object pastes just fine BUT any associated EVENTS with that objects don't get copied over.

This is a simple test I did.  One button on the form.   Added a click event test to it.
When I copy the button, then paste it, VB wants to create a new even for it with _X (where x={1...n},
like this:

  Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
        test()
    End Sub


    Private Sub Button1_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs)
        test2()
    End Sub

    Private Sub Button1_Click_2(ByVal sender As System.Object, ByVal e As System.EventArgs)

    End Sub

All I'm after is a simple copy/paste where the whole object gets moved over along with all the events, etc.

Any ideas how this is done?

Paul
Avatar of Bob Learned
Bob Learned
Flag of United States of America image

It ain't gonna happen, unfortunately.  Are you copying/pasting from one form to another?

Bob
ASKER CERTIFIED SOLUTION
Avatar of Sancler
Sancler

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial