Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How do you get this done?
Message
De
22/01/2009 20:41:41
 
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Titre:
How do you get this done?
Divers
Thread ID:
01376440
Message ID:
01376440
Vues:
50
In FoxPro I created a bunch of buttons that activated functionality in an application object that I built, and then I'd just drop the button on a form and VOILA all I had to do is populate a couple of properties at design time and away it went. Now, to get that same functionality in .NET...

Here's the classe's click code and maybe you can see my problem.

(App is a type in my main classes, and oApp is a property that holds an instance of the App object on the active form.)


****************************************************

App thisApp = (App)this.TopLevelControl.oApp;

thisApp.db.Navigate("contact",Direction.Next);


**************************************************
When I attempt to complile the above it doesn't know what to do with oApp as its not a property of the 'System.Windows.Forms.Control'.

Sure, I can set this code on each button on my form, but I like to create classes so I can reuse my code.

What am I missing, or is this just the situation with C# and you can't do this kind of thing in C# like you can in FoxPro? I can't pass an oApp to each button on my form...and I'm assuming there isn't really a thing like a global variable that the compiler can see.

Thanks!!

Bob
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform