|
-
Apr 13th, 2007, 02:59 PM
#1
Thread Starter
New Member
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
-Thanks bunches
-
Apr 13th, 2007, 03:06 PM
#2
Frenzied Member
Re: New, need to fire event within procedure
I think it is something like..
Button1.ProcessClick()
something like that
oh it is:
Button1.PerformClick()
-
Apr 13th, 2007, 03:10 PM
#3
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
-
Apr 13th, 2007, 03:32 PM
#4
Thread Starter
New Member
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|