In order to catch an event from a child form, the event has to be attached prior to showing the child form. Also, the object triggering the event needs to be public. In this case car has to be defined as public within the child form.
This code works as should, triggering the event in both forms:
Form1:
Code:
using System; using System.Windows.Forms; namespace EventTest
Leave a comment: