What I am trying to do is make a click through PictureBox. However, since I am moving the PictureBox from groupbox to groupbox, it's not as simple as "Give it the same OnClick event as the form". So what I am trying to do is use RemoveHandler and AddHandler to change the PictureBox's OnClick event to the groupbox it's attached to.
Here's an example of the concept I'm trying to use:
Public Shared Sub TransferCoin(pictureBox, groupBoxFrom, groupBoxTo)
groupBoxTo.Controls.Add(pictureBox)
groupBoxFrom.Control.Remove(pictureBox)
RemoveHandler pictureBox.Click, AddressOf pictureBox.Click.Method
AddHandler pictureBox.Click, AddressOf groupBoxTo.Click.Method
End Sub
This doesn't work because you can't just get the click method of the Picbox or groupbox.
Any help or suggestion would be greatly appreciated. *I know there are similar questions out there but this is different because the picturebox moves around and, as explained above, cannot simply be given the same event as what's behind it because what's behind it changes. *