Results 1 to 2 of 2

Thread: Help with .ToString

  1. #1

    Thread Starter
    New Member
    Join Date
    Jun 2009
    Posts
    4

    Help with .ToString

    Hi guys,

    Basically I have just started to learn about pogramming in a general sense and with Visual Basic as i need an understanding of programming for uni when i start next year.

    Now im reading through the visual basic 2008 for dummies book and im trying to follow their example but ive hit a problem and i cant see or no why.

    Heres the code:

    Public Class Form1

    Private Sub DateTimePicker1_ValueChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DateChooser.ValueChanged
    NextWeek.Text = DateChooser.Value.AddDays(7)).ToString()
    End Sub
    End Class

    The problem lies where i have ended the 6th line in ").ToString()"
    It comes up with a caption saying end of statement expected but i cant find any solution for the love of money.

    As i said i am a very beginner so please be patient with me as i'm just trying to learn like everyone else

    Thanks in advance

  2. #2
    Master Of Orion ForumAccount's Avatar
    Join Date
    Jan 2009
    Location
    Canada
    Posts
    2,802

    Re: Help with .ToString

    You have an extra bracket, it should be:

    vb.net Code:
    1. NextWeek.Text = DateChooser.Value.AddDays(7).ToString()

    EDIT:

    Just noticed this is a duplicate thread: http://www.vbforums.com/showthread.php?t=573059
    Last edited by ForumAccount; Jun 15th, 2009 at 05:31 PM.

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