Re: events delegates help
That's a misuse of an event. An event is supposed to be raised when something happens. Something evaluating to True is not something happening. If something was False and its value changed to True, that would be an appropriate time to raise an event, but the event should be raised when that change happens. Besides that, if you were to use an event you would raise it regardless of whether the child form is displayed or not. Only if the child form was displayed would it handle the event, but the event would be raised regardless.
Re: events delegates help
Thanks for that, thanks for clearing it up
well yes, I am trying to do this. I am trying to raise an event when something happens - that is what I want to do. But how would I go about doing this within those 2 forms?
Re: events delegates help
You've done exactly the same thing a thousand times I bet. Forms are no different to any other object. If you have a Button and you want to hanlde its Click event in a form you declare a variable and a method, then you assign the Button to the variable and add the method to the event. You do exactly the same thing now, except your variable and event are of a different type.
Re: events delegates help
I understand but its hard to implement.
This "editor" form is not always open so how do I go about putting in the delegate/initialising it on this form?
Sorry, I can't even remember what I am doing now lol.
Going to see where I am having problems again and get back to you more specifically.
Re: events delegates help
You write an event handler for the event in the editor form class. When the form is opened it needs a reference to the other form. If it is the main form that opens the editor form then it should pass a reference to itself as a parameter to the constructor. In the constructor or Load event handler of the editor form you attach the method to the event.