How do I set a variable number in visual basic?
-
I have an app that I made that refreshes a page according to user set definitions. The user selects the seconds, and the timer refreshes the webbrowser1 according to how many seconds there are. It loops this action. I want to put a checkbox next to the seconds that will say "Enable Variable Time" and a NumericUpDown that will have the seconds that the original time will vary. For example, I have the original NumericUpDown1.Text set to 60 (seconds). I check the "Enable Variable Time" and set a 10 second variable in NumericUpDown2.Text. After doing this, the page will refresh every 60 seconds +/- the 10 second variable (randomly any number within the range), i.e. 60 seconds will now be 61 seconds or 69 seconds, or 54 seconds, etc... It just creates a user set variable so that the original seconds vary at a max of, in this example, 10 seconds. I do not want it to be 10 seconds exactly, but to be +/- any number within the range of 10. Oh, and I want this to change every time it refreshes, so that it doesn't use the same variable setting over and over, i.e. 60 seconds and a variable of 10 seconds, becomes 63 seconds every time... I do not want this. It needs to change every time, otherwise it would be pointless. 60 seconds and a variable of 10 seconds (first refresh) becomes 63 seconds. (Second Refresh) 60 seconds and a variable of 10 seconds becomes (at random for example:) 69 seconds, and so on and so forth. I hope I am making some sense. I'm kind of new to visual basic, so keep that in mind. I can learn what to do, just use terms that I most likely would know. Thanks!
-
Answer:
Refresh = 60 + int(rnd()*10)
JedtheMa... at Yahoo! Answers Visit the source
Related Q & A:
- How do I manipulate a large number of moving platforms?Best solution by Electrical Engineering
- How can I convert a string number to a number in Perl?Best solution by Stack Overflow
- How can I get a Vanity number?Best solution by phonenumberguy.com
- How do I save a large number of incoming e-mails to my computer in one go?Best solution by Yahoo! Answers
- How can I change a mobile number in Yahoo Messenger?Best solution by Yahoo! Answers
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.