Solved

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

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

Technology Partners: 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

In earlier versions of Windows (XP and before), you could drag a database to the taskbar, where it would appear as a taskbar icon to open that database.  This article shows how to recreate this functionality in Windows 7 through 10.
You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
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…

726 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