#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2003
    Posts
    64
    Rep Power
    11

    How can I convert a Integer to be shown as label1->Text


    I want to show some integers in a label-Object! I tried

    Code:
    int test=5; label1->Text=test;
    but I got this error from VC++ .net :

    error C2664: 'System::Windows::Forms::Control::set_Text': Conversion from Parameter 1 from 'int' in 'System::String __gc *' not possible
  2. #2
  3. Huh?
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2003
    Location
    Scotland, UK
    Posts
    223
    Rep Power
    11
    does test have to be an int?

    Can you try changing it to a string?
    -----------------------------------------------------------
    4dr14n
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2003
    Posts
    109
    Rep Power
    11
    In .NET nothing could be easier...

    int test=5;
    label1->Text = test.ToString();
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2003
    Posts
    64
    Rep Power
    11
    Thanks Nem that was exactly what I was looking for.

IMN logo majestic logo threadwatch logo seochat tools logo