Solved

Study guide

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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

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…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
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…

707 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

12 Experts available now in Live!

Get 1:1 Help Now