Pass value between forms using events






3.11/5 (5 votes)
Alternatively, you could just expose some public properties and raise a standard event. In the event handler you could read the properties as usual, without having to define a new EventArgs.Also if you really need to set properties on the owner, you again could just expose some public...
Alternatively, you could just expose some public properties and raise a standard event. In the event handler you could read the properties as usual, without having to define a new EventArgs.
Also if you really need to set properties on the owner, you again could just expose some public properties and then pass the owner as an argument when calling ShowDialog(), requiring no events at all.
Which is best depends on the situation, but usually I would avoid defining a new EventArgs just to pass text around.