DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/index.php)
-   VB.NET (http://www.daniweb.com/forums/forum58.html)
-   -   Public Overrides Function ToString() (http://www.daniweb.com/forums/thread152119.html)

3Dees Oct 19th, 2008 7:54 am
Public Overrides Function ToString()
 
Hey,
Can someone explain to me how this function works in relation to a GUI output.

Public Overrides Function ToString() As String

My program do some calculation and conversions and displays the resluts in a list box. I need use this function but i am not sure how it affects my output.

Teme64 Oct 19th, 2008 2:51 pm
Re: Public Overrides Function ToString()
 
ToString() gives the textual respresentation of the object. This means with numbers that, for example, number 3 gets displayd as string "3".
ToString() also accepts format string as a parameter and this gives the full power of it. For example -123.ToString("X") returns hexadecimal representation of the number (=FFFFFF85).
You can read more about string formsts from the MSDN documentation.
Since it's overridable method you can have your own implementation of it in your own class.


All times are GMT -4. The time now is 8:52 pm.

Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC