Understanding Conversion Operators

In the previous section we discussed converting between value types and reference types. These kinds of conversions are not the only ones allowed by the .NET Framework. 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. Some controls, such as ListBox and DataGridView on the Windows side or the DataGrid on the web side can store any kind of ...

Get Visual Basic 2015 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.