Run event handler code from outside of event

Discussion in 'Microsoft VB .NET' started by Guest, May 14, 2004.

  1. Guest

    Guest Guest

    H
    In VB6 you run the event handler code from anywher
    e.g
    Call Button1_Click ran the code behind your button1 click even

    Can you do this in VB.Net and if so how
    Our system uses shortcut keys for saving, e.g. End and because focus does not leave the control the Validating event does not fire so I would like to be able to run the validating event for the aactive control when End is pressed on the form and then stop the save if the validation fails. Has anyone else dne something like this
    Thank
    Siobhan
     
    Guest, May 14, 2004
    #1
    1. Advertisements

  2. * "=?Utf-8?B?U2lvYmhhbg==?=" <> scripsit:
    > In VB6 you run the event handler code from anywhere
    > e.g.
    > Call Button1_Click ran the code behind your button1 click event
    >
    > Can you do this in VB.Net and if so how?


    Call the button's 'PerformClick' method.

    > Our system uses shortcut keys for saving, e.g. End and because focus
    > does not leave the control the Validating event does not fire so I would
    > like to be able to run the validating event for the aactive control when
    > End is pressed on the form and then stop the save if the validation
    > fails.


    Have a look at the form's 'Validate' method.

    --
    Herfried K. Wagner [MVP]
    <URL:http://dotnet.mvps.org/>
     
    Herfried K. Wagner [MVP], May 14, 2004
    #2
    1. Advertisements

  3. Guest

    Guest Guest

    H
    I actually don't want to run the Click event I just used that as an example, I would actually like to run the Validating event of a text bo
    Thank
    Siobhan
     
    Guest, May 17, 2004
    #3
  4. Guest

    Guest Guest

    Oops, sorry - I just read to the end of the post!
     
    Guest, May 17, 2004
    #4
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Mountain Bikn' Guy
    Replies:
    0
    Views:
    237
    Mountain Bikn' Guy
    Dec 16, 2003
  2. Aravind C
    Replies:
    2
    Views:
    1,405
    Michael
    Dec 16, 2003
  3. Charles Law
    Replies:
    4
    Views:
    1,508
    Herfried K. Wagner [MVP]
    Jun 10, 2004
  4. VJ

    Remove Handler.. & Add Handler...

    VJ, Jun 11, 2004, in forum: Microsoft VB .NET
    Replies:
    5
    Views:
    405
  5. Larry Lard
    Replies:
    5
    Views:
    180
    Cor Ligthert [MVP]
    Feb 8, 2006
Loading...

Share This Page