General information
Title:
How do you get this done?
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
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only