Solved

Calling on BindingNavigator Controls from other controls

Posted on 2010-09-03
3
570 Views
Last Modified: 2012-05-10
I created a great program with multiple binding navigators for easy code and run tactics.  However I wrote the application for a bunch of old fogeys that can't grasp the bindingnavigator functionality.  What they want is big easy to read ADD NEW RECORD, DELETE and SAVE record buttons.  I was thinking I could make the bindingnavigator invisible and add manual buttons and call upon the bindingnavigators built in functions.  However, that has been a bit more challenging than I though.  I tried the below code to mimic the keypress of the add button on the bindingnavigator but the read only property of sender.Pressed = false whereas if the bindingnavigator does it, it's a true value.  Am I going about this the wrong way? Or am I missing something?
 
Private Sub ToolStripButton1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton1.Click



    End Sub



    Private Sub Button_add_aap_programs_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button_add_aap_programs.Click



        Dim oSender As System.Windows.Forms.ToolStripButton = DirectCast(ToolStripButton1, System.Windows.Forms.ToolStripButton)



        ToolStripButton1_Click(oSender, e)



    End Sub

Open in new window

0
Comment
Question by:MrFantastic6
  • 2
3 Comments
 
LVL 18

Expert Comment

by:John (Yiannis) Toutountzoglou
ID: 33598334
You may delete also these buttons of the binding navigator and create your own button calling your own functions without reffering to bind.nav controls.
0
 
LVL 2

Accepted Solution

by:
MrFantastic6 earned 0 total points
ID: 33598476
I figured it out.  I like the bindingnavigator and saves me from having to call my own functions.  Here's what I had to do:


Private Sub ToolStripButton1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton1.Click 

  'the function for adding a record called by navigator 

End Sub 

 

    Private Sub Button_add_aap_programs_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button_add_aap_programs.Click 

 

        Dim oSender As System.Windows.Forms.ToolStripButton = DirectCast(ToolStripButton1, System.Windows.Forms.ToolStripButton) 



osender.PerformClick()



 

    End Sub

Open in new window

0
 
LVL 2

Author Closing Comment

by:MrFantastic6
ID: 33598507
I was missing the oSender.PerformClick() function.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
split53 challenge 7 79
DataGridview Currency Formating? 22 53
Programmatically signing Word macros 4 61
Vb.Net Date Formatting Assistance 4 35
It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
There is an easy way, in .NET, to centralize the treatment of all unexpected errors. First of all, instead of launching the application directly in a Form, you need first to write a Sub called Main, in a module. Then, set the Startup Object to th…
The goal of this video is to provide viewers with basic examples to understand and use conditional statements in the C programming language.
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…

896 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

18 Experts available now in Live!

Get 1:1 Help Now