TEAM CODING-BCA

VB program for Student Activities Form.

VB program for Student Activities Form:

Private Sub Command1_Click()

If Option1.Value = True Then
sex = "he"

ElseIf Option2.Value = True Then
sex = "she"
End If

city = Combo1.Text

If Option3.Value = True Then
l = Option3.Caption
ElseIf Option4.Value = True Then
l = Option4.Caption
ElseIf Option5.Value = True Then
l = Option5.Caption
ElseIf Option6.Value = True Then
l = Option6.Caption
End If

If Check1.Value = 1 Then
a = a + Check1.Caption + vbCrLf
End If

If Check2.Value = 1 Then
a = a + Check2.Caption + vbCrLf
End If

If Check3.Value = 1 Then
a = a + Check3.Caption + vbCrLf
End If

If Check4.Value = 1 Then
a = a + Check4.Caption + vbCrLf
End If

If Check5.Value = 1 Then
a = a + Check5.Caption + vbCrLf
End If

If Check6.Value = 1 Then
a = a + Check16.Caption + vbCrLf
End If
MsgBox Text1.Text + " is " + Text2.Text + " years old " + vbCrLf + sex + " lives in " + city + vbCrLf + sex + "is an " + l + " level athelete " + vbCrLf + "activities include" + vbCrLf + a


End Sub

Private Sub Text1_KeyPress(k As Integer)
If Not ((k >= 65 And k <= 90) Or (k >= 97 And k <= 122)) Or k = 8 Or k = 32 Then
k = 0
MsgBox "alphates only"
Text1.Text = ""

End If
End Sub

Private Sub Text2_KeyPress(k As Integer)
If Not (k >= 48 And k <= 57) Or k = 8 Or k = 32 Then
k = 0
MsgBox "numbers only"
Text2.Text = ""
End If

End Sub
Output


No comments:

Post a Comment