Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Jul 21st, 2007, 7:08 AM   #11
verion24
Newbie
 
Join Date: Jul 2007
Posts: 6
Rep Power: 0 verion24 is on a distinguished road
Thanks so much everyone, I have almost worked it all out. If i type the answer, backspace it, and type it in again, it gives the user another score. How could I resolve this?

vb Syntax (Toggle Plain Text)
  1.  
  2. Dim score As Integer
  3. Private Sub Form_Load()
  4. lblscore.Caption = score
  5. End Sub
  6. Private Sub txtquestion1_Change()
  7. If txtquestion1.Text = "beijing" Then
  8. score = score + 1
  9. lblscore.Caption = score
  10. End If
  11. End Sub
  12. Private Sub txtquestion2_change()
  13. If txtquestion2.Text = "pacific ocean" Then
  14. score = score + 1
  15. lblscore.Caption = score
  16. End If
  17. End Sub

Last edited by verion24; Jul 21st, 2007 at 7:40 AM.
verion24 is offline   Reply With Quote
Old Jul 21st, 2008, 9:13 AM   #12
Steel9561
Newbie
 
Join Date: Apr 2008
Posts: 8
Rep Power: 0 Steel9561 is on a distinguished road
Re: Completely new, please help

Hi everyone,

I am making a quiz program in Visual Basic 6.0, where the question is answered in a text box, and, if correct, a certain number of marks is added to the displayed score as you go. However, i am confused about what coding for this needs to be done, and what the scored is displayed in (a label perhaps?). So, I ask, could someone give me so example code so i get the idea how to approach this? I know its a amatuer question, but I am having trouble getting my head around what coding to use in certain situations ('if' statements, calculations, etc). Also, could someone give me a good site to learn about this stuff?

Many Thanks in advance

------------------------------------------------------------------------------------------------------
Ok, basically here you are talking about an if statement.

All you need to do is to create an if statement that checks for the accuracy fo the answer. Something like:

"IF textbox.text="AnswerCorrectHere" THEN

score=score+1

You use score to accumulate the number of correct answers. I hope this gives you an idea.
Steel9561 is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Completely oblivous CodeJunkie Assembly 30 Aug 20th, 2005 11:03 AM
Completely new to VB.NET Jaymes Visual Basic .NET 4 May 28th, 2005 7:04 PM
Completely lost, help needed bliznags C++ 2 Mar 19th, 2005 4:44 PM




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 5:19 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC