Solved

Study guide

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

ScreenConnect 6.0 Free Trial

Want empowering updates? You're in the right place! Discover new features in ScreenConnect 6.0, based on partner feedback, to keep you business operating smoothly and optimally (the way it should be). Explore all of the extras and enhancements for yourself!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Windows 10 start screen issues 9 55
Reading the Contents of a Directory In Access VBA 5 70
Spell Check in VB6 13 114
Prevent user closing word document opened with VB6 6 74
Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
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…

821 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