Format of a Label
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: Format of a Label

  1. #1
    Join Date
    Jan 2005
    Location
    Sydney
    Posts
    23

    Red face Format of a Label

    Hi People

    This is going to be easy for someone but its driving me mad.

    I trying to add this code. StopLbl.Text = (2 - 2 * ATRTb.Text) & Format(StopLbl, "$0.00")

    The Problem is this part... & Format(StopLbl, "$0.00")
    Im trying to format the label so it displays the result as $0.10 but all i get is this error... "An unhandled exception of type 'System.InvalidCastException' occurred in system.windows.forms.dll"

    If i take out the & Format(StopLbl, "$0.00") the code returns a result 0.1 when the format i want is 0.10

    If you would like to see all the code just say so and i will post it

    Thanks Poeple

    Nick

  2. #2
    Join Date
    Aug 2002
    Location
    Dubai
    Posts
    1,183

    Re: Format of a Label

    Try

    StopLbl.Text = (2 - 2 * ATRTb.Text) & Format(StopLbl.Text, "$0.00")

  3. #3
    Join Date
    Jan 2005
    Location
    Sydney
    Posts
    23

    Wink Format of a Label

    Thank you, Thank you, Thank you

    Nick

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Azure Activities Information Page

Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center