KJ,
As the others have suggested. txtMoney.Text.Format is really the shared
function String.Format, VB.NET allows you to called shared members on
instances of objects, as this example demostrates this can cause confused
results. To avoid these confused results I try to avoid calling shared
members on instances of objects (variables, properties, fields, parameters).
For details on using String.Format see:
http://msdn.microsoft.com/library/d...-us/cpguide/html/cpconcompositeformatting.asp
http://msdn.microsoft.com/library/d...ef/html/frlrfSystemStringClassFormatTopic.asp
As Chris stated, you sample is the same as:
String.Format("#,##0.00")
There are two problems with this.
1. You are not using the value returned from the Format function.
2. You did not specify any placeholders in the format specifier.
Although the second is not important, the first surely is ;-)
Try something like:
Dim amount As Decimal
Dim str As String = String.Format("The total amount is {0:#,##0.00}",
amount)
Hope this helps
Jay