event handling

  • Thread starter Thread starter Rasmus
  • Start date Start date
R

Rasmus

I need to handle an event from one form in another form.
I need to grab the event listBox1.SelectedIndexChanged, which lies in
a child form called reports and use it in my parent form.

Any ideas??

Greetings Rasmus Madsen
 
Hi Rasmus!

Rasmus said:
I need to handle an event from one form in another form.
I need to grab the event listBox1.SelectedIndexChanged, which lies in
a child form called reports and use it in my parent form.

In mainFrm, you are creating chldFrm, right?

Then you can set the Eventhandler in mainFrm:

chldFrm.listBox1.SelectedIndexChanged += new
System.EventHandler(this.childFormListBox_SelectedIndexChanged);

Then the Function childFormListBox_SelectedIndexChanged is called,
whenever the selected Index changes in the child form!

With kind regards,

Konrad
 
Back
Top