Вы находитесь на странице: 1из 12

FORM DESIGN

CODE
Private Sub Command1_Click()
Dim nos As Integer
Dim i As Integer
nos = 0
i=0
Do While i < 10
nos = InputBox("Enter 10 nos to be added", "Sum of numbers")
i=i+1
Sum = Sum + nos
Loop
Text1.Text = Val(Sum)
Sum = 0
End Sub
Private Sub Command2_Click()
Text1.Text = ""

End Sub

Private Sub Command3_Click()


End
End Sub

FORM DESIGN

CODE
Private Sub Command1_Click()
Dim a, i, leng As Integer
a=0
leng = Len(Text1.Text)
If leng = 0 Then
MsgBox "Nmae caaot be blank"
a=1
Else
For i = 1 To leng
ch = UCase(Mid(Text1.Text, i, leng))

If Not ((ch >= "A" And ch <= "z") Or (ch = "")) Then
MsgBox "Invalid Name"
Text1.Text = ""
Text1.SetFocus
a=1

End If
Next i
End If
If IsDate(Text2.Text) <> True Then
MsgBox "Invalid date"
Text2.Text = ""
Text2.SetFocus
a=1
End If

If IsNumeric(Text3.Text) <> True Or Len(Text3.Text) <> 8 Then


MsgBox "Enter a valid telephone number"
Text3.Text = ""
Text3.SetFocus
a=1
End If
If a = 0 Then
MsgBox "All data fields are valid"
MsgBox "Thankyou", vbOKOnly, "successful entry"
End If

End Sub

Private Sub Command2_Click()


Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
End Sub

Private Sub Command3_Click()


End
End Sub

OUTPUT

OUTPUT

CODE
Private Sub Command1_Click()
Shape1.Visible = True
Shape2.Visible = False
Label1.Visible = True
Label1.Caption = "LENGTH="
Label2.Visible = True
Label2.Caption = "BREADTH="
Text1.Visible = True
Text2.Visible = True
Text3.Visible = True
Command3.Visible = True
Command2.Visible = False

Command6.Visible = False
End Sub

Private Sub Command2_Click()


Shape1.Visible = False
Shape2.Visible = True
Label1.Visible = True
Label1.Caption = "RADIUS="
Text1.Visible = True
Text3.Visible = True
Command1.Visible = False
Command3.Visible = False
Command6.Visible = True
End Sub

Private Sub Command3_Click()


Dim a, b, area As Double
a = Val(Text1.Text)
b = Val(Text2.Text)
area = a * b
Text3.Text = area
End Sub

Private Sub Command5_Click()


Text1.Text = ""
Text1.Text = ""

Text1.Text = ""
End Sub

Private Sub Command4_Click()


End
End Sub
Private Sub Command6_Click()
Dim r, area As Double
r = Val(Text1.Text)
area = 3.14 * r * r
Text3.Text = area
End Sub
Private Sub Form_Load()
Label1.Visible = False
Label2.Visible = False
Text1.Visible = False
Text2.Visible = False
Text3.Visible = False
Shape1.Visible = True
Shape2.Visible = True
Command1.Visible = True
Command2.Visible = True
Command6.Visible = False
Command3.Visible = False
End Sub

FORM DESIGN

CODE
Private Sub Command1_Click()
Dim test As Boolean
Dim avg
Dim s1, s2, s3, s4, s5, s6
test = True
s1 = Val(Text1.Text)
s2 = Val(Text2.Text)
s3 = Val(Text3.Text)

s4 = Val(Text4.Text)
s5 = Val(Text5.Text)
s6 = Val(Text6.Text)
avg = (s1 + s2 + s3 + s4 + s5 + s6) / 6
Select Case test
Case s1 < 40 Or s2 < 40 Or s3 < 40 Or s4 < 40 Or s5 < 40 Or s6 < 40
Label7.Caption = "FAILED"
Case avg < 60
Label7.Caption = "Second Class "
Case Else
Label7.Caption = "First Class "
End Select
End Sub

Private Sub Command2_Click()


Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
End Sub

Private Sub Command3_Click()


End
End Sub

OUTPUT

<head>
<title>BIODATA</title>
</head>
<body>
<center>
<H1 align=center><u>BIODATA</u></H1>

<SCRIPT LANGUAGE=VBSCRIPT>

DIM NAME,DOB,GENDER,AGE,SCHOOL,COLLEGE,WORK
NAME=INPUTBOX("ENTER YOUR NAME")
DOB=INPUTBOX("ENTER YOUR DATE OF BIRTH")
AGE=YEAR(DATE)-YEAR(DOB)
DOCUMENT.WRITE("NAME :"&NAME&"<BR>")
DOCUMENT.WRITE("DOB :"&DOB&"<BR>")
DOCUMENT.WRITE("AGE :"&AGE&"<BR>")
IF AGE<=16 THEN
SCHOOL =INPUTBOX("ENTER NAME OF YOUR SCHOOL")
DOCUMENT.WRITE("SCHOOL :"&SCHOOL&"<BR>")
ELSE IF AGE<=22 AND AGE>16 THEN
COLLEGE=INPUTBOX("ENTER THE NAME OF YOUR COLLEGE")
DOCUMENT.WRITE("COLLEGE :"&COLLEGE&"<BR>")
ELSE
WORK=INPUTBOX("ENTER THE NAME OF YOUR WORK PLACE")
DOCUMENT.WRITE("WORK :"&WORK&"<BR>")
END IF
end if
</script>
</CENTER>
</BODY>
</HTML>

OUTPUT

Вам также может понравиться