Home All Groups Group Topic Archive Search About

AddHandler p.MouseClick Confusing Problem

Author
5 Sep 2006 8:06 PM
JimBob
Ok so i added this line of code to a dynamic PictureBox. (i dim it p)
AddHandler p.MouseClick, AddressOf Hand.Canvas_Click
what it would do is change the pic on the picbox but every time you
click the picturebox it raises the event several times?
Public Sub Canvas_Click(ByVal sender As System.Object, ByVal e As
System.Windows.Forms.MouseEventArgs) is the sub that it raises
i must be missin something. any ideas?

Author
5 Sep 2006 8:40 PM
Dennis
Where did you put your "addhandler" statement?
--
Dennis in Houston


Show quoteHide quote
"JimBob" wrote:

> Ok so i added this line of code to a dynamic PictureBox. (i dim it p)
> AddHandler p.MouseClick, AddressOf Hand.Canvas_Click
> what it would do is change the pic on the picbox but every time you
> click the picturebox it raises the event several times?
>  Public Sub Canvas_Click(ByVal sender As System.Object, ByVal e As
> System.Windows.Forms.MouseEventArgs) is the sub that it raises
>  i must be missin something. any ideas?
>
>