PDA

View Full Version : VB questions


kuzmin
01-29-2009, 06:17 PM
SORRY. WRONG SECTION

What's the 'Wait' command? Here's an example

Solve 2(x+3) and input your answer in the text box next to it. Here's when the wait function/command comes in. If in 30 seconds you don't answer or have the wrong answer a hint appears for 10 seconds then disappears again. What's the function?

K 0 3 D
01-29-2009, 06:21 PM
= 2x + 6 , is that what your asking?

kuzmin
01-29-2009, 06:23 PM
No, what's the wait command?

Like if the after the question is asked in exactly 30 seconds a hint will pop up. Then in exactly 10 seconds it will disappear. I'm not asking you to solve it, though..

Arsenal
01-30-2009, 12:55 AM
Use C++ and just make it in a Windows Application, I barely understand VB and C++ is better.

zumi12
02-03-2009, 02:25 PM
lol u shud hav gon 2 skool lol

Neosback
02-03-2009, 05:13 PM
lol u shud hav gon 2 skool lol

lol wow thats a funny thing to say, its not like every word you just typed is spelled wrong

kuzmin
02-03-2009, 05:17 PM
lol u shud hav gon 2 skool lol
Every word in your sentence is incorrect. Also, I go to school everyday, I'm just trying to learn faster because the class moves so slow.

gothicquir
02-03-2009, 05:27 PM
Make a timer. And enable it as soon as the question loads.

kuzmin
02-03-2009, 05:28 PM
Make a timer. And enable it as soon as the question loads.
Ooh. Haven't learned about that, but thanks!! I'll experiment.

gothicquir
02-03-2009, 05:29 PM
No problem. If you need any help with that timer, I can help you. =)

kuzmin
02-03-2009, 05:36 PM
No problem. If you need any help with that timer, I can help you. =)
Ah.. Can you post the code like how do you enable? Timer1.enabled? Give me a small tut on how to set that up.

gothicquir
02-03-2009, 05:40 PM
OK. It really depends on your version.. Like im using 2008 [VB9]. But the code is most likely to be, for all versions:

public sub form1_load
timer1.enabled = true
end sub

And the timers interval should be : 30000 for 30 seconds.
I can get into your for advanced code you need if you would like. [the hint display and what not].

kuzmin
02-03-2009, 05:49 PM
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Timer1.Enabled = True
TextBox2.Text = 100
End Sub
----------------------------------------------------------------------
How do I make this work?

When you press the button the timer goes 10 seconds which is 10000 and then 100 pops up in the textbox2.Text

I press the button1. Timer makes it wait 10 seconds and the 100 appears.

gothicquir
02-03-2009, 05:54 PM
Oh... Declare this in your timer's code... [double click timer1]

private sub timer1_tick
textbox1.text = "100"
button1.enabled = false
timer1.enabled = false
end sub

That will do it, and for the button code....

private sub button1_click
timer1.enabled = true
end sub

kuzmin
02-03-2009, 05:59 PM
Thanks.....