>I want to pass a struct as a parameter from one form to another. Where do I have to define the struct so that it is available in more than one form? In a separate class, perhaps?
>
>For a quick-and-dirty solution, I tried to copy-and-paste the struct definition from one form to another (knowing full well that this isn't the ideal solution), but the compiler rejects it, saying it can't convert the parameters.
Hilmar,
A struct is a value type. You could directly pass it as any value type (ie: int). Do you mean pass by reference? Then use ref or out.
A struct by itself is like a class (with some differences). IOW define it as if you're defining another class.
namespace myApp
{
class myForm1 {}
class myForm2 {}
struct myStruct {}
}
Cetin