Solved

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

Posted on 2009-05-14
3
486 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

820 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