Explicitly Implicit
Here's a VB.NET quirk, to get the ball rolling:
In C#, you can say this:
Size size;
SizeF sizeF;
size = new Size
(100, 100); sizeF = size;That's because the Size type has a Type Conversion defined for SizeF.
The documentation says:
In Visual Basic, you can use the conversion operators defined by a type, but you cannot define your own.
Here's an attempt to do the same thing in VB.NET:
Dim size As New Size(100,100)
Dim sizeF As SizeF 'These do not work - even with Option Strict Off'sizeF = size
'sizeF = CType(size, SizeF)
'Call op_Implicit explicitly - works!
sizeF = Size.op_Implicit(size) 'Hey - fancy VB feature... With sizesizeF =
New SizeF(.Width, .Height) End WithIs this behaviour the same in VB.NET 2003?