Hi,
You can NOT use the same name on more than one control in
the same form. Yes, you can use the same event procedures
for multiple controls. There are more than one way to do
this. I will give you the easiest approach:
1. Put code in the event procedure (I suspect you are
using the Click event) that you want for one of the
controls.
2. For all controls that are to use the same code, you
can add on the control and event name in the handles
clause of the event procedure:
Private Sub cmdSave_Click(byVal Sender as Object, ByVal e
as system.eventargs) handles cmdSave.Click,
cmdSave2.Click, cmdSave3.Click
In the above sample, the event procedure will run when the
click event occurs for all three controls.
Now, if you have some differences in code based on which
control actually received the event, you will need to
check the Sender object to examine which control and then
do the appropriate action that is specific to the actual
control that received the event. I suspect you do not
need to apply this code as yet. If you do, ask, and you
will receive.
I hope this helps. My email address has only 2 "k"s in
it. Carol
-----Original Message-----
You have to use different names, but you can at least use
the same eventhandlers.
cmdSave.Click += new System.EventHandler(Save_Click);
mnuSave.Click += new System.EventHandler(Save_Click);
Sorry for the C#.
HTH;
Eric Cadwell
http://www.origincontrols.com
.