M
Mike Cooper
There is something about inherited classes I evidently don't know...
I wrote the following class:
Class Class1
inherits System.Windows.Forms.DataGridTextBoxColumn
End Class
There is absolutely no added functionality to it.
Then, in Sub Main, I have the following code.
Dim hihi as Datagridtextboxcolumn
Dim hehe as Class1
hehe = ctype(hihi,class1)
The above code failes with a cast not valid error!!
My real code is considerably more complex ofcourse. But in order to
find out
why my "cast is not valid" I have reduced it to the skeleton code
above. Because class1 is a undistinguished child of
DataGridTextBoxColumn, I see no reason why an object of the parent
cannot be Ctyped into an object of the child. But it can't. Can
anyone tell me why. I am using Visualbasic.net if that makes a
difference. Please let me know.
Thanks,
Mike Cooper
I wrote the following class:
Class Class1
inherits System.Windows.Forms.DataGridTextBoxColumn
End Class
There is absolutely no added functionality to it.
Then, in Sub Main, I have the following code.
Dim hihi as Datagridtextboxcolumn
Dim hehe as Class1
hehe = ctype(hihi,class1)
The above code failes with a cast not valid error!!
My real code is considerably more complex ofcourse. But in order to
find out
why my "cast is not valid" I have reduced it to the skeleton code
above. Because class1 is a undistinguished child of
DataGridTextBoxColumn, I see no reason why an object of the parent
cannot be Ctyped into an object of the child. But it can't. Can
anyone tell me why. I am using Visualbasic.net if that makes a
difference. Please let me know.
Thanks,
Mike Cooper