Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

active x conrol programming

Posted on 1998-07-07
4
Medium Priority
?
180 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 200 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

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

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

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Suggested Courses

618 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