Calling for a toolbar-button methode from another methode

Posted on 2011-10-01
Last Modified: 2013-12-16

I have a toolbar-button that has a tbDelNote_ItemClick-event.
Now I want to call for the tbDelNote_ItemClick-event from another

I have tried:
1. tbDelNote_ItemClick()
2. tbDelNote_ItemClick(sender)
3.t bDelNote_ItemClick(self)

But these 3 attemps did not work.
How can i call for the tbDelNote_ItemCLick event?

P.S: I am only all day but I only can test the solution tonight.


Peter Kiers

private void tbDelNote_ItemClick(object sender, ItemClickEventArgs e)
            foreach (ListViewItem item in lvNotes.SelectedItems)

Open in new window

Question by:peterkiers
    LVL 40

    Accepted Solution

    The method needs 2 parameters, so you need to pass 2 parameters. Since you are not using either the sender or the IetmClickEventArgs inside of the event, simply pass null.

    Open in new window

    LVL 1

    Author Comment

    Oke I'll test it tonight.

    Can this be done too: tbDelNote_ItemCLick(Sender, e);

    LVL 40

    Expert Comment

    by:Jacques Bourgeois (James Burger)
    sender and e would then need to be declared. What would you put in sender? What you put in e?

    The sender is usually the caller of the event. e are parameters sent to the event. Since you use neither in the procedure, it would be useless to send those parameters.

    Featured Post

    Maximize Your Threat Intelligence Reporting

    Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

    Join & Write a Comment

    Recently while returning home from work my wife (another .NET developer) was murmuring something. On further poking she said that she has been assigned a task where she has to serialize and deserialize objects and she is afraid of serialization. Wha…
    For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK ( for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
    Need more eyes on your posted question? Go ahead and follow the quick steps in this video to learn how to Request Attention to your question. *Log into your Experts Exchange account *Find the question you want to Request Attention for *Go to the e…
    Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

    755 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    21 Experts available now in Live!

    Get 1:1 Help Now