Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How do you get this done?
Message
From
22/01/2009 20:41:41
 
 
To
All
General information
Forum:
ASP.NET
Category:
Other
Title:
How do you get this done?
Miscellaneous
Thread ID:
01376440
Message ID:
01376440
Views:
47
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
Next
Reply
Map
View

Click here to load this message in the networking platform