Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Shared struct
Message
From
13/07/2005 10:03:55
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
13/07/2005 09:47:15
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Title:
Miscellaneous
Thread ID:
01032193
Message ID:
01032209
Views:
21
This message has been marked as the solution to the initial question of the thread.
>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
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform