Link to home
Start Free TrialLog in
Avatar of MrFantastic6
MrFantastic6Flag for United States of America

asked on

Calling on BindingNavigator Controls from other controls

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

Avatar of John (Yiannis) Toutountzoglou
John (Yiannis) Toutountzoglou
Flag of Greece image

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.
Avatar of MrFantastic6
Flag of United States of America image

Link to home
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of MrFantastic6


I was missing the oSender.PerformClick() function.