65.9K
CodeProject is changing. Read more.
Home

Pass value between forms using events

starIconstarIconstarIcon
emptyStarIcon
starIcon
emptyStarIcon

3.11/5 (5 votes)

Aug 5, 2010

CPOL
viewsIcon

12631

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.