Click here to Skip to main content
15,867,686 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
I want to decrease textbox value by 0,15 every second with timer tick. i use c# net framework
for examle textbox1 value is 10000 and textbox2 value = 0,15
so i want every second textbox1 to be reduced by 0,15(textbox2)so it will be( 10000 , 9.999,85 , 9.999,7 .......0)
thanks in advance!

What I have tried:

i cant find the timer tick code to do this
Posted
Updated 24-Jul-20 23:42pm
v2

Quote:
cant find the timer tick code
Does it occur to you that maybe you should write it yourself? The Timer control inVB.NET can be found in the toolbox, so you can add that to your form quite easily. Once you have that then you can read the MSDN documentation to see how to use it.
 
Share this answer
 
Comments
Patrice T 25-Jul-20 6:09am    
+5
Quote:
I want to decrease textbox value by 0,15 every second with timer tick.

Do yourself a favor and stop combining problems.
- First problem: you want to launch/run a piece of code every seconds with a timer. Google gives heaps of answers in any language/framework you want.
- Second problem: you want to decrease a value in a piece of code.
 
Share this answer
 
Double click on the timer control in design view and it will generate the tick event for you. Then, in the event you can read in the textbox value, convert to double, then subtract, and put it back into the textbox.
 
Share this answer
 
This is the same question as you asked yesterday: Decrease value of textbox within another textbox[^]

The answer hasn't changed, nor will it - ZurdoDev's answer is the same as the one I gave you then.

We aren't going to write all the code for you - you wouldn't learn anything if we did. SO follow the C# links I gave you, read the answers ZurdoDev and I wrote, and start working out exactly what to type. We aren't going to give you something you can hand in as your own work...
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900