Solved

Study guide

Posted on 1998-12-12
5
147 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 200 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

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 …
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
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…
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…

863 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

22 Experts available now in Live!

Get 1:1 Help Now