Hi,
I am doing some code which involves type conversion and have run into a
problem I find odd.
I have a control of type class1 in a referenced assembly called
subclassedcontrols.
The line below used to work in other code, Facet is a property of my class1
control which inherits from a normal textbox
MessageBox.Show(CType(ctl, SubClassedControls.Class1).Facet & ctl.Text)
Exception message is:
An unhandled exception of type 'System.InvalidCastException' occurred in
VisualNotepad.exe
Additional information: Specified cast is not valid.
BUT this line executes OK in the command window
?CType(ctl, SubClassedControls.Class1).Facet & ctl.Text
Any pointers? I cannot understand why it should work in the command window
but not in the code running
Best regards,
Andrew