Solved

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

Posted on 2009-05-14
3
487 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Phishing attempts can come in all forms, shapes and sizes. No matter how familiar you think you are with them, always remember to take extra precaution when opening an email with attachments or links.
AutoNumbers should increment automatically, without duplicates.  But sometimes something goes wrong, and the next AutoNumber value is a duplicate.  This article shows how to recover from this problem.
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

738 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