|
-
May 5th, 2013, 07:39 PM
#1
Thread Starter
New Member
Changing TextBox through time
To first start off, I am completely new to coding. I just now started vb.net not too long ago. I was wondering how I would make a TextBox's text change like every five seconds. For example, I have a Text Box currently set to nothing. When I click a button, it will change the text, then it will wait 3 seconds and the text would change to something else... and so on. Sorry for the run on sentence, haha. If anyone could help, it would be much appreciated!
Thanks!
-
May 5th, 2013, 07:52 PM
#2
Addicted Member
Re: Changing TextBox through time
You could use a Timer, set its interval to 3000 (3 seconds) and on its Tick event you change the text of the Textbox.
-
May 5th, 2013, 07:54 PM
#3
New Member
Re: Changing TextBox through time
 Originally Posted by MetalInquisitor
You could use a Timer, set its interval to 3000 (3 seconds) and on its Tick event you change the text of the Textbox.
lol and what is the code for that?
-
May 5th, 2013, 08:02 PM
#4
Thread Starter
New Member
Re: Changing TextBox through time
 Originally Posted by CodyCoder
lol and what is the code for that?
Wondering the same thing.
-
May 5th, 2013, 08:09 PM
#5
Re: Changing TextBox through time
TextBox and Timer. Hardly the most complex controls on the board. Look it up and see if you can work it out! You should be able to do it with three lines of code, two of which the IDE will write for you!
As the 6-dimensional mathematics professor said to the brain surgeon, "It ain't Rocket Science!"
Reviews: "dunfiddlin likes his DataTables" - jmcilhinney
Please be aware that whilst I will read private messages (one day!) I am unlikely to reply to anything that does not contain offers of cash, fame or marriage!
-
May 5th, 2013, 08:11 PM
#6
Addicted Member
Re: Changing TextBox through time
-You add a Timer to your Form.
-In the Timer properties, you set the Interval to 3000, so that the Timer's Tick event fires every 3 seconds.
-In the Timer's Tick event you write code to display whatever it is you want on the TextBox.
-On the Button Click event you start the Timer.
That's about it.
-
May 5th, 2013, 08:17 PM
#7
New Member
Re: Changing TextBox through time
I know but like as far as ive learned in vb if you told it to textbox1's text = whatever, that changes, but how do you get it to 15 + items for example... to alternate between random ones, maybe do select case statements in the timer tick event.
-
May 5th, 2013, 08:19 PM
#8
Re: Changing TextBox through time
maybe do select case statements in the timer tick event
Maybe! Here's a crazy idea. Try it and see. You learn nothing from having everything done for you!
As the 6-dimensional mathematics professor said to the brain surgeon, "It ain't Rocket Science!"
Reviews: "dunfiddlin likes his DataTables" - jmcilhinney
Please be aware that whilst I will read private messages (one day!) I am unlikely to reply to anything that does not contain offers of cash, fame or marriage!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|