0% found this document useful (0 votes)
75 views2 pages

VB Cashregister

This document contains Visual Basic code for a quiz game that generates random numbers, stores user input in text boxes and lists, and conditionally displays messages based on the input. The code initializes variables, generates random single-digit numbers, compares text box values to the random numbers, calculates a score, and conditionally adds strings to lists and displays messages based on the score. It also includes code to display the current time and form caption in the title bar and request a username and password on form load.

Uploaded by

Limberto Suarez
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
75 views2 pages

VB Cashregister

This document contains Visual Basic code for a quiz game that generates random numbers, stores user input in text boxes and lists, and conditionally displays messages based on the input. The code initializes variables, generates random single-digit numbers, compares text box values to the random numbers, calculates a score, and conditionally adds strings to lists and displays messages based on the score. It also includes code to display the current time and form caption in the title bar and request a username and password on form load.

Uploaded by

Limberto Suarez
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 2

Suarez, Limberto B.

B.S.I.T. – 2D
Prof. Tabios
Private Sub Command3_Click() Else
Dim a, b, c, d, e, f, g, h, i As Integer MsgBox ("Welcome visitor!")
Dim j As String End If
Randomize Time Label8.Caption = "Hello " & a & "!"
a = Int(Rnd * 9) + 1 End Sub
Text5.Text = a
b = Int(Rnd * 9) + 1 Private Sub Text1_KeyPress(KeyAscii As Integer)
Text6.Text = b If KeyAscii = 13 Then
c = Int(Rnd * 9) + 1 List1.AddItem Text1.Text
Text7.Text = c Text2.SetFocus
If Text2.Text = Text5.Text Then End If
d=1 End Sub
Else
d=0 Private Sub Text2_KeyPress(KeyAscii As Integer)
End If If KeyAscii = 13 Then
If Text3.Text = Text6.Text Then Text3.SetFocus
e=1 End If
Else End Sub
e=0
End If Private Sub Text3_KeyPress(KeyAscii As Integer)
If Text4.Text = Text7.Text Then If KeyAscii = 13 Then
f=1 Text4.SetFocus
Else End If
f=0 End Sub
End If
g=d+e+f Private Sub Timer1_Timer()
h = "1" Dim strmess As String
i = "0" strmess = formcap & " " & Time
j="" If strmess <> Caption Then
If g = 3 Then Caption = strmess
List3.AddItem h End If
List4.AddItem i End Sub
List1.AddItem j
Else
List4.AddItem h
List3.AddItem i
List1.AddItem j
End If
End Sub

Private Sub Form_Load()


formcap = Me.Caption
Dim a, b As String
a = InputBox("Please enter user name", "User's
Information", "Type here")
b = InputBox("Please enter password", "User's
Information", "Type here")
If b = "09101347" Then
MsgBox ("Welcome admin ambet! :)")

You might also like