Results 1 to 5 of 5

Thread: [RESOLVED] Label text problem

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2013
    Posts
    336

    Resolved [RESOLVED] Label text problem

    Hi,

    What am I doing wrong here:

    Code:
    Label1.Text = "The system will reboot in " + Reboot_Timer + " seconds, to finalize any settings..." + Environment.NewLine + Environment.NewLine + "Please standby!"
    it's error says something about a double.....

  2. #2
    Addicted Member MetalInquisitor's Avatar
    Join Date
    Sep 2012
    Posts
    143

    Re: Label text problem

    Use & for concatenation, NOT +.

    I assume Reboot_Timer is some numeric value...

    vb.net Code:
    1. Label1.Text = "The system will reboot in " & Reboot_Timer.toString & " seconds, to finalize any settings..." & Environment.NewLine & Environment.NewLine & "Please standby!"

  3. #3
    PowerPoster dunfiddlin's Avatar
    Join Date
    Jun 2012
    Posts
    8,245

    Re: Label text problem

    & Reboot_Timer.toString
    Actually if you use the correct operator, &, then the conversion is inferred and the explicit conversion is unnecessary, so the error wouldn't ever have arisen.
    As the 6-dimensional mathematics professor said to the brain surgeon, "It ain't Rocket Science!"

    Reviews: "dunfiddlin likes his DataTables" - jmcilhinney

    Please be aware that whilst I will read private messages (one day!) I am unlikely to reply to anything that does not contain offers of cash, fame or marriage!

  4. #4

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2013
    Posts
    336

    Re: Label text problem

    ThankS

  5. #5
    Addicted Member MetalInquisitor's Avatar
    Join Date
    Sep 2012
    Posts
    143

    Re: Label text problem

    Quote Originally Posted by dunfiddlin View Post
    Actually if you use the correct operator, &, then the conversion is inferred and the explicit conversion is unnecessary, so the error wouldn't ever have arisen.
    That makes sense. Thanks.

Posting Permissions

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



Click Here to Expand Forum to Full Width