Conversion Operators

In the previous section we discussed converting between value types and reference types. Such kinds of conversions are not the only ones allowed by the .NET Framework because you often need to perform conversions between two value types or two reference types. For example, imagine that you want to represent a number as a text message. In such a case, you need to convert an Integer into a String; you could also have an Integer value that must be passed to a method that instead receives an argument of type Double. Another common scenario is when you work with user controls in the user interface. There are some controls such as ListBox and DataGridView on the Windows side or the DataGrid on the web side that can store any ...

Get Visual Basic® 2010 Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.