Solved

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

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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Suggested Solutions

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…
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
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…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

762 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

23 Experts available now in Live!

Get 1:1 Help Now