liquid8 Posted January 19, 2003 Posted January 19, 2003 I have been trying to find out how exactly you can embed classes/methods to get the following line to be processed: Pages(1).Buttons(1).Add How would a basic class look for this? Or would you have to create a Namespace? I was trying to do something like: Class Pages Class Buttons Property Add() End Property End Buttons End Class But I don't see a way or can't pass an index to a Class, can I? Basically, I want properties within properties or methods within methods.. Thanks in advance, liquid8 Quote
*Gurus* divil Posted January 19, 2003 *Gurus* Posted January 19, 2003 That's not "embedding" classes or methods. In this case, you would define your Pages class, and you would define a strongly-typed collection called ButtonCollection or something. Then you'd make a readonly property in the Pages class called Buttons, of type ButtonCollection. Assuming the ButtonCollection had an Add method, you could then do, Pages.Buttons.Add(blah) For more help on creating a strongly-typed collection, see the CollectionBase class in the help. You'll have to inherit this. If you wanted Pages itself to be a collection, you'd have to have to go two levels higher and write a PageCollection class, and have another class to host a property called Pages, of that type. Quote MVP, Visual Developer - .NET Now you see why evil will always triumph - because good is dumb. My free .NET Windows Forms Controls and Articles
liquid8 Posted January 20, 2003 Author Posted January 20, 2003 looks a bit more difficult than i thought.. i'll look more into the collectionbase.. thanks for steering me in the right direction. LiQuiD8 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.