Write a programin VB.Net to design following form. Accept Number from user with proper validations Select radio button ,after clicking command button display result in textbox.if number2 is entered zero and operator is division then display error message 'Divide By Zero' in result textbox.(use exception handling)
Public Class Form1 Private Sub butexit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles butexit.Click Application.Exit() End Sub Private Sub butcal_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles butcal.Click Dim A, B, R As Integer A = Convert.ToDouble(txtno1.Text) B = Convert.ToDouble(txtno2.Text) Try If rdbadd.Checked = True Then R = A + B ElseIf rdbdiv.Checked = True Then R = A / B ElseIf rdbmul.Checked = True Then R = A * B ElseIf rdbsub.Checked = True Then R = A - B End If txtres.Text = R Catch ex As Exception txtres.Text = "Divide By Zero Error" End Try End Sub End Class
Write a programin VB.Net to design following form. Accept Number from user with proper validations Select radio button ,after clicking command button display result in textbox.if number2 is entered zero and operator is division then display error message 'Divide By Zero' in result textbox.(use exception handling)
Reviewed by
on
April 27, 2015
Rating: