Hey there.

How do i execute the code in button1 when i click on button2?

I have no idea and will save me alot of coding

thank you =)

Hey there.

How do i execute the code in button1 when i click on button2?

I have no idea and will save me alot of coding

thank you =)

No Worries, i found it.

button2.PerformClick();

Chow

So if you have a button, say "Print document" you have a second button and you want it to perform the same action?
You could put a call to the same method in both buttons, if that is what you really want to do. Or else I misunderstood your question. In that case more explanation is appreciated.

So if you have a button, say "Print document" you have a second button and you want it to perform the same action?
You could put a call to the same method in both buttons, if that is what you really want to do. Or else I misunderstood your question. In that case more explanation is appreciated.

=) Yes thats exactly what i wanted to do. =) i just found out how to accomplish it, because i was trying to update my datagridwiew, and i can do it 100% with a button, but as soon as i try to do it with a menu strip, it doesnt want to.

So i thought ill just invoke the update button again. i found out you can do it with

button2.PerformClick();

Thank you =)

This question has already been answered. Start a new discussion instead.