New, need to fire event within procedure
I'm studying IT right now, so this is for my classwork. I need to fire a button click event within the menu click event procedure. Simple stuff, I'm just new, and none of this was in our reading/the teacher won't write me back. I'll keep my eye out for a word back :wave:
-Thanks bunches
Re: New, need to fire event within procedure
I think it is something like..
Button1.ProcessClick()
something like that
oh it is:
Button1.PerformClick()
Re: New, need to fire event within procedure
if the button and menu are supposed to perform the same exact action
(for example lets say a form has a close button on it, and the menu also has a file -> close menu item on it)
you can just make the same routine handle both events by using the handles clause and using both control's click events...
Code:
Private Sub DoAction(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuClose.Click, cmdClose.Click
'PERFORM ACTIONS HERE WHEN EITHER BUTTON OR MENU ITEM IS CLICKED
End Sub
Re: New, need to fire event within procedure
Wow, thanks guys! Fromethius, I used your command, the btnWrite.PerformClick() specifically, and it worked like a charm. kleinma, your input was also gretaly appreciated, I just tried the easiest looking avenue first ^_^ Maybe I should demand a refund on my teacher's chunk of my tuition and start paying you guys for help. :cool: That said, I'm in the process of transferring in two weeks, for anyone thinking "Why doesn't she leave THAT school."
Thanks again :thumb: