Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Shared struct
Message
De
13/07/2005 10:03:55
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
13/07/2005 09:47:15
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Titre:
Divers
Thread ID:
01032193
Message ID:
01032209
Vues:
22
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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform