Solved

Calling a binding navigator button C#2008 and visual studios 2008.

Posted on 2009-05-14
3
485 Views
Last Modified: 2012-05-07
I am creating a program to edit a database using c#2008 with visual studios 2008. I want to click a button that I have made and it execute the a button on the binding navigator tool bar. This is so it is more user friendly.

For example I want to be able to click a button I have made for adding a new entry and it execute the plus button on the binding navigator tool bar.

I am using the code
cmdAddUser.Click += new System.EventHandler(bindingNavigatorAddNewItem_Click);

this however will only execute any code that I have put into the 'bindingNavigatorAddNewItem_Click' not the database functionality. I want it to execute the database functionality as well. How do I do that?

Many thanks in advance
David
0
Comment
Question by:delta_v
  • 2
3 Comments
 
LVL 1

Author Comment

by:delta_v
ID: 24383697
has anyone got any ideas
0
 
LVL 7

Expert Comment

by:zwei
ID: 24408276
Add another eventhandler to the button.
cmdAddUser.Click += new System.EventHandler(bindingNavigatorAddNewItem_Click);
cmdAddUser.Click += new System.EventHandler(myEvent);
 
 
// myEvent needs to have these two parameters and void returntype to fit the EventHandler delegate.
void myEvent(object sender, EventArgs e)
{
    //do database stuff
}

Open in new window

0
 
LVL 1

Accepted Solution

by:
delta_v earned 0 total points
ID: 24472624
The above comment only allows for a second event to be run from one click.  Unfortanlty i have run out of time for this project.
0

Featured Post

The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.

770 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