I’ve got a class called ‘MusicNote’ which inherits from ‘PictureBox’. I’m trying to make it drag vertically when the user clicks on it and moves the mouse up/down. I’ve pasted the code below, which works. The problem is that it only works the first time – i.e. the user drags it and it’s placed in the new position as it’s supposed to. However, when I click it again and drag – it disappears. Any ideas?
I’ve got a class called ‘MusicNote’ which inherits from ‘PictureBox’. I’m trying to make
Share
Problem is with the MouseUp event handler. In that event you will have to unsubscribe to MouseMove event handler.
Multiple subscription to same event is causing your controls top value to be negative.