Solved

active x conrol programming

Posted on 1998-07-07
4
174 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Before we dive into the marketing strategies involved with creating an effective homepage, it’s crucial that EE members know what a homepage is. In essence, a homepage is the introductory, or default page, of a website that typically highlights the …
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…

772 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

10 Experts available now in Live!

Get 1:1 Help Now