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.
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:
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 :)
can u make me a code.
like 1 min is the given time...
make it
59sec
58sec...
till to 0..
tnx
LUnarcry52 2 years ago
Comment removed
MrCoreyBrantley 2 years ago
Hey I Have a tut on my channel About How To Make A 1 Min Count Down Timer
MrCoreyBrantley 2 years ago
only if a runtime error occurs
jishan22 2 years ago
i can't see
billy23888 3 years ago 2
oh, btw, i'm using VB2008 express edition, if that matters.
Nighthawk213 3 years ago
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?
Nighthawk213 3 years ago
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)
killroy7777 3 years ago
Correct:
Label1.Text = Val(Label1.Text) + 1
TextBox1.Text = Val(TextBox1.Text) + 1
cheatonly2win 3 years ago
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? :(
zoek1anderehobby 3 years ago
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.
kevin10987 3 years ago
i copyed it...
zoek1anderehobby 3 years ago
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!"
kevin10987 3 years ago
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 ()
kevin10987 3 years ago
Change "dummyString.Substring(0, 11)" to "dummyString", but it shows milliseconds and 100-nanoseconds that are constant.
jishan22 2 years ago
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 :)
zoek1anderehobby 2 years ago
cool!!!
javyer1314 4 years ago
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.
kevin10987 4 years ago
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.
kevin10987 4 years ago