Results 1 to 4 of 4

Thread: events between forms

  1. #1

    Thread Starter
    Fanatic Member Crash893's Avatar
    Join Date
    Dec 2005
    Posts
    930

    events between forms

    I have a mdi parent form and a logon form (among others)

    I'm trying to create an event that will be triggered from the logon form when the users "logon"

    the code i have so far is

    in the logon form

    c# Code:
    1. public event EventHandler Authenticated;

    and in the main form


    c# Code:
    1. logon newForm = new logon();
    2.             newForm.Authenticated += new EventHandler(?????????);
    3.             newForm.MdiParent = this;


    my two questions are

    1) what should i put under the event handler and (makred in ???)
    2) and how would i create a "stub" for it in the main form

    i.e
    c# Code:
    1. private void ???????(object sender, EventArgs e)
    2.         {
    3.            
    4.         }


    thanks if you can point me in the right direction

  2. #2
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687

    Re: events between forms

    in your third code block, give your function a name....replacing the ???s that are there
    Then, use that name in the second code block to replace the ????s that are there....

    Name of the handler isn't as important as the signature of the handler. You can call it Crash893BiggestHitsOfAllTimeThroughOutHistory ... just as long as the parameters of it match the event's signature.

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  3. #3

    Thread Starter
    Fanatic Member Crash893's Avatar
    Join Date
    Dec 2005
    Posts
    930

    Re: events between forms

    soooo


    Quote Originally Posted by Crash893 View Post


    c# Code:
    1. logon newForm = new logon();
    2.             newForm.Authenticated += new EventHandler(crash893);
    3.             newForm.MdiParent = this;


    my two questions are



    i.e
    c# Code:
    1. private void crash893(object sender, EventArgs e)
    2.         {
    3.            //whatever code here
    4.         }

    should put me in the right place?

  4. #4
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687

    Re: events between forms

    yup, something like that.

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

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