Thursday, August 7, 2014

VB.NET CODE TO PERFORMED ARITHMETICAL OPERATION

Public Class Form3
    Dim x, y, r As Integer

    Private Sub btadd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btadd.Click
        If txtn1.Text = "" Then
            MessageBox.Show("PLs Fill TextFiled1")
            txtn1.Focus()
        ElseIf txtn2.Text = "" Then
            MessageBox.Show("PLs Fill TextFiled2")
            txtn2.Focus()
        Else
            x = CInt(txtn1.Text)
            y = CInt(txtn2.Text)
            r = x + y
            txtr.Text = r.ToString
        End If
    End Sub

    Private Sub btnreset_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnreset.Click
        If txtn1.Text = "" Then
            MessageBox.Show("PLs Fill TextFiled1")
        ElseIf txtn2.Text = "" Then
            MessageBox.Show("PLs Fill TextFiled2")
        Else
            txtn1.Text = ""
            txtn2.Text = ""
            txtr.Text = ""
            txtn1.Focus()
        End If

    End Sub

    Private Sub btnsub_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnsub.Click
        If txtn1.Text = "" Then
            MessageBox.Show("PLs Fill TextFiled1")
        ElseIf txtn2.Text = "" Then
            MessageBox.Show("PLs Fill TextFiled2")
        Else
            x = txtn1.Text
            y = txtn2.Text
            r = x - y
            txtr.Text = r
        End If

    End Sub

    Private Sub btnmul_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnmul.Click
        x = txtn1.Text
        y = txtn2.Text
        r = x * y
        txtr.Text = r
    End Sub

    Private Sub btndiv_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btndiv.Click
        x = txtn1.Text
        y = txtn2.Text
        r = x / y
        txtr.Text = r
    End Sub

    Private Sub btnrem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnrem.Click
        x = txtn1.Text
        y = txtn2.Text
        r = x Mod y
        txtr.Text = r
    End Sub

    Sub validity()
       
    End Sub

End Class

No comments:

Post a Comment

JAC Board Computer || IIT 2025 || Introductory Information Technology || Class 10 || Practical Examination 2025

Marks Division HOE 30 Marks IT Application Report File 20 Marks Viva - Voce 10 Marks 1) Write an HTML code to generate a web p...