Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Study guide

Posted on 1998-12-12
5
Medium Priority
?
154 Views
Last Modified: 2010-05-03
I have a list of latin roots and the deffinitions i wish to make a small program that will show the definition and have you enter the root. What i got so far is a text box a lable and a command button what i want to happen is when i click the command button it will put a random definition in the label and have you enter the correct root for that definition into the text block. I will need to do this for about 100-200 roots. I just need the basic code then i can extend it to how many roots i have.

Please give me the Visual Basic 3.0 codeing

Thanks
0
Comment
Question by:swdea
  • 2
  • 2
5 Comments
 
LVL 2

Expert Comment

by:trillo
ID: 1449653
Need more info, How do you have the latin roots and their definitions? in a file?.. in a database?
0
 
LVL 3

Accepted Solution

by:
jbil earned 800 total points
ID: 1449654
'This example uses two listbox's with visible prop set to false 'the list's are loaded with values on form load
'you could optionly fill them any way you want

Private Sub Command1_Click()
Dim mynum As Integer
Randomize
mynum = Int((6 * Rnd) + 1)
List1.ListIndex = mynum
List2.ListIndex = mynum
Label1.Caption = List1.List(mynum)
Text1.Text = ""
Text1.SetFocus
End Sub

Private Sub Form_Load()
mystring = "definition"
For i = 1 To 6
    List1.AddItem mystring & CStr(i)
Next

mystring = "root"
For i = 1 To 6
    List2.AddItem mystring & CStr(i)
Next

End Sub

Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer)

If KeyCode = 13 Then
    If Text1.Text = List2.Text Then
     Label1.Caption = "Right"
    Else
     Label1.Caption = "wrong"
    End If
End If
End Sub

0
 

Author Comment

by:swdea
ID: 1449655
with your code it works but i dont see how to put multiple definitions and roots.

I would prefer that all the root and definitions are in the sorce. Thanks
0
 
LVL 3

Expert Comment

by:jbil
ID: 1449656
>I have a list of latin roots and the deffinitions
What is this list?
If you send a few lines of it I will show you how to extract values from it and add them to listboxes.

If I understand, you have to have roots and defs somewhere, in a file, database, array, collection, etc.
If you had files (roots.txt and defs.txt) you would open them and put values in listboxs


Or do you want to fill the boxes at design time?(painfully slow work)
 
btw the line in above code should be
mynum = Int((List1.ListCount * Rnd))

not
mynum = Int((6 * Rnd) + 1)

0
 

Author Comment

by:swdea
ID: 1449657
Thanks that is how i wanted to do it right at disighn time Thanks again.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
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 …
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 lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

877 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