954,535 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Run menustrip menu item from code

I have tried to google this but returned nothing useful;

I have code which runs in a menu item (StartToolStripMenuItem_Click).
Later in the project i want to code clicking this menu item but if i just use the StartToolStripMenuItem_Click sub it wants the 'e' argument passed to it. I simply can not work out what i should be passing.....any ideas please.

Many Thanks
David

gingernob
Newbie Poster
2 posts since May 2011
Reputation Points: 10
Solved Threads: 0
 


This

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
       
        StartToolStripMenuItem.PerformClick()
       
End Sub


Or This

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
       
       StartToolStripMenuItem_Click(StartToolStripMenuItem, EventArgs.Empty)

End Sub
Unhnd_Exception
Posting Pro
570 posts since Nov 2010
Reputation Points: 249
Solved Threads: 201
 

Thank you so much....exactly what i needed.

gingernob
Newbie Poster
2 posts since May 2011
Reputation Points: 10
Solved Threads: 0
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: