P
Paul King
Hello, experts:
I have a beginner's question. I would like to know if there is a sensible way
of writing event handlers under VB. For a Numeric Update control called
"nudSpin", this is apparently wrong:
Private Sub nudSpin_MouseUp() Handles nudSpin.MouseUp
' my code
End Sub
I get an error which says "Method 'nudSpin_MouseUp' cannot handle Event
'MouseUp' because they do not have the same signature."
OK, so what is this signature stuff about? If I create the method header the
old fashioned (VB6) way (by clicking on the control), I get:
Private Sub nudSpin_ValueChanged(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles nudSpin.ValueChanged
' place code here
End Sub
which is not what I want. I don't want a response to a changed value, I want a
response to someone releasing a mouse button while using the control. If I
changed the "Handles" modifier to "Handles nudSpin.MouseUp, I get the
signature error again.
I don't get this signature stuff. I am not using prorpietary controls, and
after reading warnings on this newsgroup, I have avoided ActiveX controls
(even though VB tells me they are available). The controls for this program
appear to be native to Microsoft VB.NET. Why can't I handle the events I want
to handle?
Thanks for any light you can shed on this
Paul King
I have a beginner's question. I would like to know if there is a sensible way
of writing event handlers under VB. For a Numeric Update control called
"nudSpin", this is apparently wrong:
Private Sub nudSpin_MouseUp() Handles nudSpin.MouseUp
' my code
End Sub
I get an error which says "Method 'nudSpin_MouseUp' cannot handle Event
'MouseUp' because they do not have the same signature."
OK, so what is this signature stuff about? If I create the method header the
old fashioned (VB6) way (by clicking on the control), I get:
Private Sub nudSpin_ValueChanged(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles nudSpin.ValueChanged
' place code here
End Sub
which is not what I want. I don't want a response to a changed value, I want a
response to someone releasing a mouse button while using the control. If I
changed the "Handles" modifier to "Handles nudSpin.MouseUp, I get the
signature error again.
I don't get this signature stuff. I am not using prorpietary controls, and
after reading warnings on this newsgroup, I have avoided ActiveX controls
(even though VB tells me they are available). The controls for this program
appear to be native to Microsoft VB.NET. Why can't I handle the events I want
to handle?
Thanks for any light you can shed on this
Paul King