Visual Basic 6.0 Practical Exercises Pdf -
Keywords: Visual Basic 6.0 practical exercises PDF, VB6 programming practice, download VB6 lab manual, VB6 projects for students
Code:
Private Sub Button1_Click()
If Text1.Text = "VB6" Then
MsgBox "Found!"
Else
MsgBox "Not Found!"
End If
End Sub
Exercise 12 – Simple Interest Calculator visual basic 6.0 practical exercises pdf
Design a form with three text boxes (Principal, Rate, Time), a command button “Calculate”, and a label to display the result. Write code to compute Simple Interest = (P × R × T) / 100. Display the result in a message box or label. Add error handling for non-numeric inputs. Keywords: Visual Basic 6
Code:
Private Sub Button1_Click()
On Error GoTo ErrHandler
Dim num1 As Integer
Dim num2 As Integer
num1 = Text1.Text
num2 = 0
Label1.Caption = num1 / num2
Exit Sub
ErrHandler:
MsgBox "Error: Division by zero!"
End Sub