Hi
I have created one form that has an event handler, coded in the
following lines :
(ON FORM1 : Picture Boxes, when clicked they fire events)
this.OnPADClick += new FrmPAD.OnPADCli ckEventHandler
(this.FrmPAD_On PADClick);
private void ArrowUp_Click(o bject sender, System.EventArg s e)
{
int iNumToPass = 0;
System.EventArg s p = new System.EventArg s();
OnPADClick (this, p, iNumToPass);
return;
}
public delegate void OnPADClickEvent Handler (object sender,
System.EventArg s e, long num);
public event OnPADClickEvent Handler OnPADClick;
private void FrmPAD_OnPADCli ck (object sender, System.EventArg s e, long
theNum)
{
switch(theNum)
{
case 0:
MessageBox.Show ("Click on PictureBox !");
break;
default:
break;
}
}
(ON FORM2, What I want to do) :
I need to get the event from another form (Form2), using the same kind
of function as "private void FrmPAD_OnPADCli ck(object sender,
System.EventArg s e, long theNum);"
Could anyone point me in the right direction... What piece of code to
add to Form2 to get events fired from Form1 ?
Thank you very much.
I have created one form that has an event handler, coded in the
following lines :
(ON FORM1 : Picture Boxes, when clicked they fire events)
this.OnPADClick += new FrmPAD.OnPADCli ckEventHandler
(this.FrmPAD_On PADClick);
private void ArrowUp_Click(o bject sender, System.EventArg s e)
{
int iNumToPass = 0;
System.EventArg s p = new System.EventArg s();
OnPADClick (this, p, iNumToPass);
return;
}
public delegate void OnPADClickEvent Handler (object sender,
System.EventArg s e, long num);
public event OnPADClickEvent Handler OnPADClick;
private void FrmPAD_OnPADCli ck (object sender, System.EventArg s e, long
theNum)
{
switch(theNum)
{
case 0:
MessageBox.Show ("Click on PictureBox !");
break;
default:
break;
}
}
(ON FORM2, What I want to do) :
I need to get the event from another form (Form2), using the same kind
of function as "private void FrmPAD_OnPADCli ck(object sender,
System.EventArg s e, long theNum);"
Could anyone point me in the right direction... What piece of code to
add to Form2 to get events fired from Form1 ?
Thank you very much.
Comment