How can I write code/event code for ToolBar Button individually?

I made a form, and a toolbar with two buttons in it. When I tried to use button click, it goes to toolbar click (not button click). Hence, i could not write code for individual buttons. I am sure that I am missing some events. How to do it?

toolBar1

toolBarButton1

toolBarButton2

It creates event only to toolBar1_ButtonClick

Unable to work find what is wrong.

Thanks in advance.

Jil

[399 byte] By [Jil] at [2007-12-17]
# 1
Nothing is wrong, you are doing it right. All the toolbar know is that you are clicking one of the buttons on it. It doesn't know which one. So on the toolBar1_ButtonClick event, it should say something like- private void toolBar1_ButtonClick(object sender, toolBarClickEventArgs e) -
What you are interested in is that 'e' there. In your code inside the event, type e and then a '.' and if you are using VS it should give you some options with intellisense.One of those options should be something along the lines of e.Button or something.
Play with it and see what you can come up with. Reply if you still can't figure it out.
adwins04 at 2007-9-9 > top of Msdn Tech,Windows Forms,Windows Forms Designer...
# 2

Great adwins04, it works. I just got some more hints from msdn, it did work.

Thanks a lot.

Jil.

Jil at 2007-9-9 > top of Msdn Tech,Windows Forms,Windows Forms Designer...