Scour World

Home Blogs Videos Music Diary Files Friends Programming Books Store

Notepad Coder IDE: Basic Calculator using VB.NET

June 28, 2022

Notepad Coder 6.0 IDE: Download

Code File: 107.zip

From the past we teach you how to create VB Projects, now lets study the program code calculatorVBNET.

1. Changes at Project File for Registry and File Properties

<PropertyGroup>

    <AssemblyName>CalculatorVBNET</AssemblyName>

    <Version>1.0.0.0</Version>

    <Authors>Lawrence Albert Pardo-Ilao</Authors>

    <Company>Company Unlock For Us</Company>

    <Product>Distance Computation</Product>

    <AssemblyVersion>2.0.0.0</AssemblyVersion>

    <FileVersion>1.0.0.0</FileVersion>

    <NeutralLanguage>en</NeutralLanguage>

    <Description>Calculator in VBNET using Computers</Description>

    <Copyright>Copyright @ 2022 All rights will be served</Copyright>


Form1 Code Excerpt:

  Private Sub btn7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)

    'Key Push means Adding the previous


    Text0.Text = Text0.Text & "2"

  End Sub

  Private Sub btn8_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)

    Text0.Text = Text0.Text & "3"

  End Sub

  Private Sub btn9_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)

    '= (equals)

    If Text0.Tag = "plus" Then

      Text0.Text = (Prev + Double.Parse(Text0.Text)).ToString()

      Prev = Convert.ToDouble(Text0.Text)

    End If

    If Text0.Tag = "minus" Then

      Text0.Text = (Prev - Double.Parse(Text0.Text)).ToString()

      Prev = Convert.ToDouble(Text0.Text)

    End If

    If Text0.Tag = "multiply" Then

      Text0.Text = (Prev * Double.Parse(Text0.Text)).ToString()

      Prev = Convert.ToDouble(Text0.Text)

    End If

    If Text0.Tag = "divide" Then

      Text0.Text = (Prev / Double.Parse(Text0.Text)).ToString()

      Prev = Convert.ToDouble(Text0.Text)

    End If

  End Sub


  Public Prev as Double = 0

  Private Sub btn10_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)

    '+ (plus)

    Text0.Tag = "plus"

    Prev = Convert.ToDouble(Text0.Text)

    Text0.Text = ""

  End Sub

    'and many more code

    '=======================================

Have Fun!




Visitors: 5782


Copyright @2022, All rights will be served.