competency exam

0 comments
looping statements

Private Sub Command1_Click()
List1.AddItem Text1.Text
Text1.Text = ""
Text1.SetFocus
Label4.Caption = List1.ListCount
Command1.Enabled = False
End Sub

Private Sub Command2_Click()
Dim remove As Integer
remove = List1.ListIndex
If remove >= 0 Then
List1.RemoveItem remove
Label4.Caption = List1.ListCount
End If
End Sub

Private Sub Command3_Click()
List1.Clear
Label4.Caption = List1.ListCount
End Sub

Private Sub Command4_Click()
Unload Me
End Sub



Private Sub Command5_Click()
Dim sort As Boolean
Dim i As Integer
Dim s As String
Do
sort = False
For i = 0 To List1.ListCount - 2
If (List1.List(i) > List1.List(i + 1)) Then
sort = True
s = List1.List(i)
List1.List(i) = List1.List(i + 1)
List1.List(i + 1) = s
End If
Next i
Loop Until sort = False
End Sub

Private Sub Form_Load()
Text1.Text = " "
Command1.Enabled = False
End Sub

Private Sub Label4_Click()
List1.Clear
Label4.Caption = List1.ListCount
End Sub

Private Sub Text1_Change()
If (Len(Text1.Text) > 0) Then
Command1.Enabled = True
End If
End Sub

calcu
Private txtnum1, txtnum2, txtsum, txtdif, txtpro, txtquo As Integer

Private Sub Command1_Click()
txtsum = txtnum1 + txtnum2
Text3.Text = Str(txtsum)
End Sub

Private Sub Command2_Click()
txtdif = txtnum1 - txtnum2
Text3.Text = Str(txtdif)
End Sub

Private Sub Command3_Click()
txtpro = txtnum1 * txtnum2
Text3.Text = Str(txtpro)
End Sub

Private Sub Command4_Click()
txtquo = txtnum1 / txtnum2
Text3.Text = Str(txtquo)
End Sub

Private Sub Form_Load()
txtnum1 = 0
txtnum2 = 0
txtnum3 = 0
Text1.Text = nNum1
Text2.Text = nNum2
Text3.Text = nSum
End Sub

Private Sub Label4_Click()
txtsum = txtnum1 + txtnum2
Text3.Text = Str(txtquo)
End Sub

Private Sub Text1_Change()
txtnum1 = Val(Text1.Text)
End Sub

Private Sub Text2_Change()
txtnum2 = Val(Text2.Text)
End Sub

Private Sub Text3_Change()
txtnum3 = Val(Text3.Text)
End Sub

option
Private textmul, bill As Integer

Private Sub Command1_Click()
txtmul = bill * Text1.Text
Text2.Text = Str(txtmul)
End Sub

Private Sub Command2_Click()
Unload Me
Form1.Show
End Sub

Private Sub Command3_Click()
Unload Me
Form2.Show
End Sub

Private Sub Form_Load()
Text1.Text = stext1
Text2.Text = stext2
End Sub

Private Sub Option1_Click()
If Option1.Value = True Then
Check1.Value = 1
Check2.Value = 0
Check3.Value = 0
Check4.Value = 0
bill = 12000
End If
End Sub

Private Sub Option2_Click()
If Option2.Value = True Then
Check1.Value = 0
Check2.Value = 0
Check3.Value = 1
Check4.Value = 0
bill = 1000
End If
End Sub

Private Sub Option3_Click()
If Option3.Value = True Then
Check1.Value = 1
Check2.Value = 1
Check3.Value = 1
Check4.Value = 1
bill = 700
End If
End Sub