I tried to do something like this:
m_mystruct = (Form1.mystruct)m_myclass.mystruct;
where both structs have same definition.
C# doesn’t want to do the cast.
Update: instead of why, I modify my question
How do I pass a struct from a class to a winform ?
If they are defined in two separate places then they are actually two different types.
You could define explicit and implicit operators to convert between the two. It might look like this.
Think about whether you really need two different declarations. But, whatever you decide do not do the following unless you absolutely have no other choice. It could go wrong in so many different ways.
or