![]() | |
![]() |
| | Thread Tools | Search this Thread | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
SelectedClass=selectclass(True) SelectedClass.Test=10 For this to compile (with Option Strict On) you have to declare SelectedClass as a type that has a Test property. Why don't you make SelectClass return that type instead? Mattias -- Mattias Sjögren [C# MVP] mattias @ mvps.org http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com Please reply only to the newsgroup. |
#3
| |||
| |||
|
|
SelectedClass=selectclass(True) SelectedClass.Test=10 |
|
Thank you for your answer. The problem is that I won't be able to find out which type (in this case class) is going to be selected in the function. I mean which one Dim C1 as new Class1 C1=SelectClass(true) Or Dim C2 as new Class2 C2=SelectClass(false) The other problem is that the structures of these classes are completely different. So, I can't come up with a specific format. "Mattias Sjgren" wrote: SelectedClass=selectclass(True) SelectedClass.Test=10 For this to compile (with Option Strict On) you have to declare SelectedClass as a type that has a Test property. Why don't you make SelectClass return that type instead? Mattias -- Mattias Sjgren [C# MVP] mattias @ mvps.org http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com Please reply only to the newsgroup. |
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
| |