Solved

active x conrol programming

Posted on 1998-07-07
4
176 Views
Last Modified: 2013-11-25
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
Comment
Question by:cfrericks
  • 2
4 Comments
 

Expert Comment

by:russelldavis
ID: 1465182
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
 
LVL 2

Accepted Solution

by:
Jagar earned 100 total points
ID: 1465183
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
 

Author Comment

by:cfrericks
ID: 1465184
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
 

Expert Comment

by:russelldavis
ID: 1465185
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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
The purpose of this video is to demonstrate how to set up the WordPress backend so that each page automatically generates a Mailchimp signup form in the sidebar. This will be demonstrated using a Windows 8 PC. Tools Used are Photoshop, Awesome…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…

816 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now