Results 1 to 4 of 4

Thread: New, need to fire event within procedure

  1. #1

    Thread Starter
    New Member iwalkonstars's Avatar
    Join Date
    Apr 2007
    Posts
    9

    Question 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

  2. #2
    Frenzied Member
    Join Date
    Mar 2006
    Location
    Pennsylvania
    Posts
    1,069

    Re: New, need to fire event within procedure

    I think it is something like..

    Button1.ProcessClick()

    something like that

    oh it is:

    Button1.PerformClick()

  3. #3
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    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

  4. #4

    Thread Starter
    New Member iwalkonstars's Avatar
    Join Date
    Apr 2007
    Posts
    9

    Smile 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. That said, I'm in the process of transferring in two weeks, for anyone thinking "Why doesn't she leave THAT school."

    Thanks again

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width