Okay, I think VB.Net doesn't allow polymorphism between functions that differ only by the return types.
I have a class called Manager and it has a collection property called Cards. Within this Cards property, I have stored different objects (different class).
So what I want to do is to return the items whichever needed. Below is an example of what I want. (The codes do not work!)
VB Code:
'In class Manager. '************** public property Item(byval vIndex as Integer) as clsCardA 'Or clsCardB or clsCardC? 'Methods to get an object from the Manager collection property with the index passed in.) end property
So what it'll do is to check the index, get the object and return the appropriate object.
I know I can put the function return type as object but then when I try to use the function, it won't show me the public methods, properties of that returned object.
Please help.




Reply With Quote