[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 181
  • Last Modified:

active x conrol programming

I'm making a trivia game with active x in vb 5. I'm really stumped on what to do. The game has 10 questions with 4 multiple choice answers each. I tried making a label for each answer and using the label click procedure for when the user clicked on an answer. I also wanted the user to be allowed only 10 seconds for each question so i used a timer control that would do that, but then I couldn't figure out how to use the timer for each different question, I could only find a way to use it with each question and that would have mean i would have needed 10 timer controls.  I also wanted there to be a 2 second delay after the user clicked the right answer for him to go to the next question. I couldn't find a way to do that without using 10 more timer controls.  I thought about using java instead of active x, but i dont' know alot about java.   If anyone has any suggestions to help me please post them. Thanks.
0
cfrericks
Asked:
cfrericks
  • 2
1 Solution
 
russelldavisCommented:
If I were you, before spending too much time on this project, I would recommend learning VB a lot better first. If you are having trouble with the timers, its going to get a lot harder than that! If you get a good feel for the language first (buy a book, take a class, etc.) and then do the project, you'll save a lot of time and it will turn out a lot better. I started a Trivia program myself once as well, and if you want to make it good, its not as easy as you think. Good Luck!
0
 
JagarCommented:
Here is some code for the click event of the label (make sure and use Control Arrays here)

private sub lblAnswer_Click
  timer.enabled = false  'cause the timer to start counting again
  timer.interval = 2000  'for the two second display
  timer.tag = "Short"    'identify that you're on the short delay
  timer.enabled = true   'restart the counting
end sub


'use whatever is the default procedure I think it's timer, but might by something else.
private sub Timer_Timer()
  if timer.tag = "Short" then
    timer.enabled = false
    timer.interval = 10000
    timer.tag = ""
    timer.enabled = true
    'show new questions here
  else
    'no answer was given time ran out
    'show next set of questions
    'restart timer (ie timer.enabled = false, timer.enabled =   true)
  end if

Let me know how this works out for you
0
 
cfrericksAuthor Commented:
Jagar, when you put timer.enabled=false doesn't that disable the counter, not start the counting? I think you might have gotten them mixed up in there, but i might be wrong.  RusselDavis, I have a book and I've made a few programs with vb.  My book isn't on active x though, it's on vb 5 general. Do you think  I should get a book on active x only?
0
 
russelldavisCommented:
Unless your book covers a lot of ActiveX, I would definitely recommend getting a book on ActiveX. My best recommendation would be Dan Applemans' ActiveX Guide For the Perplexed. You can read the entire thing for free at http://www.mcp.com
Good Luck!
0

Featured Post

Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now