Duplicate Object Names ? - I must have goofed something.

  • Thread starter Thread starter Miro
  • Start date Start date
M

Miro

What have I done wrong here.

I use to have a tool strip button called home on my tool strip on the top of
my form.
By double clicking on the button, I got my sub to show as follows.

Private Sub tsbHome_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs)
<code was here ...but is irrelevant>
End Sub


If I look at my form code, the above is still there. But now, if I double
click on my exact same button, it pulls up
a brand new sub. ( below )...totally ignoring the one above. It also put a
_1 on it. The "NAME" property of the
button is still tsbHome.

Private Sub tsbHome_Click_1(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles tsbHome.Click

End Sub


This is happening to a couple of my buttons. Any ideas what I have done
wrong, and what i can do to fix this?

Thanks,

Miro
 
Miro said:
What have I done wrong here.

I use to have a tool strip button called home on my tool strip on
the top of my form.
By double clicking on the button, I got my sub to show as follows.

Private Sub tsbHome_Click(ByVal sender As System.Object, ByVal
e As System.EventArgs)
<code was here ...but is irrelevant>
End Sub


If I look at my form code, the above is still there. But now, if I
double click on my exact same button, it pulls up
a brand new sub. ( below )...totally ignoring the one above. It
also put a _1 on it. The "NAME" property of the
button is still tsbHome.

Private Sub tsbHome_Click_1(ByVal sender As System.Object, ByVal
e As System.EventArgs) Handles tsbHome.Click

End Sub


This is happening to a couple of my buttons. Any ideas what I have
done wrong, and what i can do to fix this?


The "Handles.." part is missing at tsbHome_Click. That's why there's no
association between the sub and the event. If you select the Click event, it
must create a new sub "*_1" because there's already one with the default
name. Don't know why "Handles" has been removed, perhaps by some
cut&paste/drag&drop.


Armin
 
That makes sence.
I was doing some cutting and pasting between some toolbars. It probably
cleared it.

I never realized it actually links thru the "Handles" portion.

Thank you, - it makes sense now.

Miro
 
Back
Top