Added: 4 years ago
From: kevin10987
Views: 8,567
Sort by time | Sort by thread (beta)

Link to this comment:

Share to:
see all

All Comments (14)

Sign In or Sign Up now to post a comment!
  • can u make me a code.

    like 1 min is the given time...

    make it

    59sec

    58sec...

    till to 0..

    tnx

  • Hey I Have a tut on my channel About How To Make A 1 Min Count Down Timer

  • only if a runtime error occurs

  • i can't see

  • oh, btw, i'm using VB2008 express edition, if that matters.

  • hi, i want to make a counter with which every time i click the button it adds one to the existing amount, can you tell me how to do that plz?

  • I can tell you,

    If you are using a label then it would be like this:

    Label1 = Label + 1

    Text Field:

    Text1 = Text1 + 1

    (make sure that the Text field / Label has a caption of 0)

  • Correct:

    Label1.Text = Val(Label1.Text) + 1

    TextBox1.Text = Val(TextBox1.Text) + 1

  • Index and length must refer to a location within the string.

    Parameter name: length

    cause of this :

    Me.Text = dummyString.Substring(0, 11) & vbCrLf & "Happy New Year!"

    now what? :(

  • Are you sure you are typing,

    Me.Label1.Text = dummyString.SubString(0,11) & vbCrLf & "Happy New Year!"

    In your code above you are just typing Me.text which is just changing the current form's text property.

    Also, that error message that you are getting tells me that your dummyString doesn't hold 12 characters, meaning that you need to double check your code with the "futureDate.subtract" code part and make sure that value that is returned gets passed to dummyString variable.

  • i copyed it...

  • Well, re-type this line instead of copying it, if it still doesn't work.

    Dim dummyString As String = _

    futureDate.Subtract(Date.Now()­).toString ()

    If you omit the underscore, then the dummyString is never going have any values, but also if you neglect the underscore, then the program won't compile because the assign operator (equals) is incomplete.

    Test to see if you have anything in your dummyString: Change,

    Me.Label1.Text = dummyString.SubString(0) & vbCrLf & "Happy New Year!"

  • If the test on the dummyString fails, when you try to retrieve everything in the object, then the object only contains this "". You will have to go back to where the dummyString obtains data, which is:

    Dim dummyString As String = _

    futureDate.Subtract(Date.Now()­).toString ()

  • Change "dummyString.Substring(0, 11)" to "dummyString", but it shows milliseconds and 100-nanoseconds that are constant.

  • well ty for the answer the only problem is I kinda gave up on VB. I've managed to make a few nice things but I got more into flash html php and javascript :)

  • cool!!!

  • Here are the steps that you will need to go through to get the same results:

    1. Click New Project from the File menu.

    2. Name the project CountDownApplication.

    3. Click OK.

    4. Change the Background color of the form to black.

    5. Add a label to the form.

    6. Change the forecolor (text color) to green.

    7. Change the font size to 16 and change the font style to bold.

  • 8. Now add a timer to your application.

    9. Set the timer property to enable, so that the timer event will run.

    10. Now double click on the timer control.

    11. Add the code that I provided in the "About This Video".

    12. Now run the application and watch the time countdown.

Loading...
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more