VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



VB.NET Calculator

by Chirantan Bhattacharjee (6 Submissions)
Category: Windows System Services
Compatability: VB.NET
Difficulty: Unknown Difficulty
Originally Published: Sat 4th November 2006
Date Added: Mon 8th February 2021
Rating: (1 Votes)

VB.NET Calculator

Rate VB.NET Calculator



Option Compare Text
Option Explicit On 

Public Class Form1
    Inherits System.Windows.Forms.Form
    Dim STR As String = "0"
    Dim temp As String
    Dim int As Integer = 0
    Dim mmy As String = "0"
#Region " Windows Form Designer generated code "

    Public Sub New()
        MyBase.New()

        'This call is required by the Windows Form Designer.
        InitializeComponent()

        'Add any initialization after the InitializeComponent() call

    End Sub

    'Form overrides dispose to clean up the component list.
    Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
        If disposing Then
            If Not (components Is Nothing) Then
                components.Dispose()
            End If
        End If
        MyBase.Dispose(disposing)
    End Sub

    'Required by the Windows Form Designer
    Private components As System.ComponentModel.IContainer

    'NOTE: The following procedure is required by the Windows Form Designer
    'It can be modified using the Windows Form Designer.  
    'Do not modify it using the code editor.
    Friend WithEvents Timer1 As System.Windows.Forms.Timer
    Friend WithEvents PictureBox1 As System.Windows.Forms.PictureBox
    Friend WithEvents Splitter1 As System.Windows.Forms.Splitter
    Friend WithEvents Timer2 As System.Windows.Forms.Timer
    Friend WithEvents PictureBox2 As System.Windows.Forms.PictureBox
    Friend WithEvents GroupBox1 As System.Windows.Forms.GroupBox
    Friend WithEvents Label1 As System.Windows.Forms.Label
    Friend WithEvents Button1 As System.Windows.Forms.Button
    Friend WithEvents Button2 As System.Windows.Forms.Button
    Friend WithEvents Button3 As System.Windows.Forms.Button
    Friend WithEvents Button4 As System.Windows.Forms.Button
    Friend WithEvents Button8 As System.Windows.Forms.Button
    Friend WithEvents Button9 As System.Windows.Forms.Button
    Friend WithEvents Button10 As System.Windows.Forms.Button
    Friend WithEvents Button11 As System.Windows.Forms.Button
    Friend WithEvents Button18 As System.Windows.Forms.Button
    Friend WithEvents Button19 As System.Windows.Forms.Button
    Friend WithEvents Button20 As System.Windows.Forms.Button
    Friend WithEvents Button21 As System.Windows.Forms.Button
    Friend WithEvents Button25 As System.Windows.Forms.Button
    Friend WithEvents Button26 As System.Windows.Forms.Button
    Friend WithEvents Button27 As System.Windows.Forms.Button
    Friend WithEvents Button28 As System.Windows.Forms.Button
    Friend WithEvents Button32 As System.Windows.Forms.Button
    Friend WithEvents Button33 As System.Windows.Forms.Button
    Friend WithEvents Button34 As System.Windows.Forms.Button
    Friend WithEvents Button35 As System.Windows.Forms.Button
    Friend WithEvents AxBalloonTipDemo1 As AxBalloonTipOCXDemo.AxBalloonTipDemo
    Friend WithEvents CALCULATOR2007 As System.Windows.Forms.NotifyIcon
    Friend WithEvents MainMenu1 As System.Windows.Forms.MainMenu
    Friend WithEvents MenuItem1 As System.Windows.Forms.MenuItem
    Friend WithEvents MenuItem2 As System.Windows.Forms.MenuItem
    Friend WithEvents MenuItem3 As System.Windows.Forms.MenuItem
    Friend WithEvents MenuItem4 As System.Windows.Forms.MenuItem
    Friend WithEvents Button5 As System.Windows.Forms.Button
    Friend WithEvents Button6 As System.Windows.Forms.Button
    Friend WithEvents Button7 As System.Windows.Forms.Button
    Friend WithEvents Button12 As System.Windows.Forms.Button
    Friend WithEvents Button13 As System.Windows.Forms.Button
    Friend WithEvents Label2 As System.Windows.Forms.Label
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
        Me.components = New System.ComponentModel.Container()
        Dim resources As System.Resources.ResourceManager = New System.Resources.ResourceManager(GetType(Form1))
        Me.Timer1 = New System.Windows.Forms.Timer(Me.components)
        Me.PictureBox1 = New System.Windows.Forms.PictureBox()
        Me.Splitter1 = New System.Windows.Forms.Splitter()
        Me.Timer2 = New System.Windows.Forms.Timer(Me.components)
        Me.PictureBox2 = New System.Windows.Forms.PictureBox()
        Me.GroupBox1 = New System.Windows.Forms.GroupBox()
        Me.Label2 = New System.Windows.Forms.Label()
        Me.Button13 = New System.Windows.Forms.Button()
        Me.Button5 = New System.Windows.Forms.Button()
        Me.Button6 = New System.Windows.Forms.Button()
        Me.Button7 = New System.Windows.Forms.Button()
        Me.Button12 = New System.Windows.Forms.Button()
        Me.Button32 = New System.Windows.Forms.Button()
        Me.Button34 = New System.Windows.Forms.Button()
        Me.Button35 = New System.Windows.Forms.Button()
        Me.Button18 = New System.Windows.Forms.Button()
        Me.Button19 = New System.Windows.Forms.Button()
        Me.Button20 = New System.Windows.Forms.Button()
        Me.Button21 = New System.Windows.Forms.Button()
        Me.Button25 = New System.Windows.Forms.Button()
        Me.Button26 = New System.Windows.Forms.Button()
        Me.Button27 = New System.Windows.Forms.Button()
        Me.Button28 = New System.Windows.Forms.Button()
        Me.Button11 = New System.Windows.Forms.Button()
        Me.Button10 = New System.Windows.Forms.Button()
        Me.Button9 = New System.Windows.Forms.Button()
        Me.Button8 = New System.Windows.Forms.Button()
        Me.Button4 = New System.Windows.Forms.Button()
        Me.Button3 = New System.Windows.Forms.Button()
        Me.Button2 = New System.Windows.Forms.Button()
        Me.Button1 = New System.Windows.Forms.Button()
        Me.Label1 = New System.Windows.Forms.Label()
        Me.Button33 = New System.Windows.Forms.Button()
        Me.CALCULATOR2007 = New System.Windows.Forms.NotifyIcon(Me.components)
        Me.AxBalloonTipDemo1 = New AxBalloonTipOCXDemo.AxBalloonTipDemo()
        Me.MainMenu1 = New System.Windows.Forms.MainMenu()
        Me.MenuItem1 = New System.Windows.Forms.MenuItem()
        Me.MenuItem2 = New System.Windows.Forms.MenuItem()
        Me.MenuItem3 = New System.Windows.Forms.MenuItem()
        Me.MenuItem4 = New System.Windows.Forms.MenuItem()
        Me.GroupBox1.SuspendLayout()
        CType(Me.AxBalloonTipDemo1, System.ComponentModel.ISupportInitialize).BeginInit()
        Me.SuspendLayout()
        '
        'Timer1
        '
        Me.Timer1.Enabled = True
        '
        'PictureBox1
        '
        Me.PictureBox1.Image = CType(resources.GetObject("PictureBox1.Image"), System.Drawing.Bitmap)
        Me.PictureBox1.Location = New System.Drawing.Point(-112, 8)
        Me.PictureBox1.Name = "PictureBox1"
        Me.PictureBox1.Size = New System.Drawing.Size(160, 32)
        Me.PictureBox1.TabIndex = 0
        Me.PictureBox1.TabStop = False
        '
        'Splitter1
        '
        Me.Splitter1.Name = "Splitter1"
        Me.Splitter1.Size = New System.Drawing.Size(3, 515)
        Me.Splitter1.TabIndex = 1
        Me.Splitter1.TabStop = False
        '
        'Timer2
        '
        Me.Timer2.Enabled = True
        '
        'PictureBox2
        '
        Me.PictureBox2.BackColor = System.Drawing.Color.Transparent
        Me.PictureBox2.Image = CType(resources.GetObject("PictureBox2.Image"), System.Drawing.Bitmap)
        Me.PictureBox2.Location = New System.Drawing.Point(272, 392)
        Me.PictureBox2.Name = "PictureBox2"
        Me.PictureBox2.Size = New System.Drawing.Size(184, 112)
        Me.PictureBox2.TabIndex = 2
        Me.PictureBox2.TabStop = False
        '
        'GroupBox1
        '
        Me.GroupBox1.Controls.AddRange(New System.Windows.Forms.Control() {Me.Label2, Me.Button13, Me.Button5, Me.Button6, Me.Button7, Me.Button12, Me.Button32, Me.Button34, Me.Button35, Me.Button18, Me.Button19, Me.Button20, Me.Button21, Me.Button25, Me.Button26, Me.Button27, Me.Button28, Me.Button11, Me.Button10, Me.Button9, Me.Button8, Me.Button4, Me.Button3, Me.Button2, Me.Button1, Me.Label1, Me.Button33})
        Me.GroupBox1.FlatStyle = System.Windows.Forms.FlatStyle.Flat
        Me.GroupBox1.Font = New System.Drawing.Font("Microsoft Sans Serif", 14.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.GroupBox1.Location = New System.Drawing.Point(16, 40)
        Me.GroupBox1.Name = "GroupBox1"
        Me.GroupBox1.Size = New System.Drawing.Size(360, 352)
        Me.GroupBox1.TabIndex = 3
        Me.GroupBox1.TabStop = False
        '
        'Label2
        '
        Me.Label2.AutoSize = True
        Me.Label2.Font = New System.Drawing.Font("Tahoma", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.Label2.ForeColor = System.Drawing.Color.White
        Me.Label2.Location = New System.Drawing.Point(16, 25)
        Me.Label2.Name = "Label2"
        Me.Label2.Size = New System.Drawing.Size(0, 14)
        Me.Label2.TabIndex = 38
        '
        'Button13
        '
        Me.Button13.BackColor = System.Drawing.Color.RosyBrown
        Me.Button13.Font = New System.Drawing.Font("Tahoma", 15.75!, System.Drawing.FontStyle.Bold)
        Me.Button13.Location = New System.Drawing.Point(152, 112)
        Me.Button13.Name = "Button13"
        Me.Button13.Size = New System.Drawing.Size(56, 40)
        Me.Button13.TabIndex = 37
        '
        'Button5
        '
        Me.Button5.BackColor = System.Drawing.Color.LightYellow
        Me.Button5.Font = New System.Drawing.Font("Tahoma", 15.75!, System.Drawing.FontStyle.Bold)
        Me.Button5.Location = New System.Drawing.Point(216, 112)
        Me.Button5.Name = "Button5"
        Me.Button5.Size = New System.Drawing.Size(56, 40)
        Me.Button5.TabIndex = 36
        Me.Button5.Text = "sqt"
        '
        'Button6
        '
        Me.Button6.BackColor = System.Drawing.Color.CadetBlue
        Me.Button6.Font = New System.Drawing.Font("Tahoma", 15.75!, System.Drawing.FontStyle.Bold)
        Me.Button6.Location = New System.Drawing.Point(216, 256)
        Me.Button6.Name = "Button6"
        Me.Button6.Size = New System.Drawing.Size(56, 40)
        Me.Button6.TabIndex = 35
        Me.Button6.Text = "00"
        '
        'Button7
        '
        Me.Button7.BackColor = System.Drawing.Color.RosyBrown
        Me.Button7.Font = New System.Drawing.Font("Tahoma", 15.75!, System.Drawing.FontStyle.Bold)
        Me.Button7.Location = New System.Drawing.Point(216, 160)
        Me.Button7.Name = "Button7"
        Me.Button7.Size = New System.Drawing.Size(56, 40)
        Me.Button7.TabIndex = 34
        Me.Button7.Text = "+/-"
        '
        'Button12
        '
        Me.Button12.BackColor = System.Drawing.Color.CadetBlue
        Me.Button12.Font = New System.Drawing.Font("Tahoma", 15.75!, System.Drawing.FontStyle.Bold)
        Me.Button12.Location = New System.Drawing.Point(216, 208)
        Me.Button12.Name = "Button12"
        Me.Button12.Size = New System.Drawing.Size(56, 40)
        Me.Button12.TabIndex = 33
        Me.Button12.Text = "."
        '
        'Button32
        '
        Me.Button32.BackColor = System.Drawing.Color.RosyBrown
        Me.Button32.Font = New System.Drawing.Font("Tahoma", 15.75!, System.Drawing.FontStyle.Bold)
        Me.Button32.Location = New System.Drawing.Point(280, 112)
        Me.Button32.Name = "Button32"
        Me.Button32.Size = New System.Drawing.Size(56, 40)
        Me.Button32.TabIndex = 32
        Me.Button32.Text = "/"
        '
        'Button34
        '
        Me.Button34.BackColor = System.Drawing.Color.SandyBrown
        Me.Button34.Font = New System.Drawing.Font("Tahoma", 15.75!, System.Drawing.FontStyle.Bold)
        Me.Button34.Location = New System.Drawing.Point(88, 112)
        Me.Button34.Name = "Button34"
        Me.Button34.Size = New System.Drawing.Size(56, 40)
        Me.Button34.TabIndex = 30
        Me.Button34.Text = "c"
        '
        'Button35
        '
        Me.Button35.BackColor = System.Drawing.Color.SandyBrown
        Me.Button35.Font = New System.Drawing.Font("Tahoma", 15.75!, System.Drawing.FontStyle.Bold)
        Me.Button35.Location = New System.Drawing.Point(24, 112)
        Me.Button35.Name = "Button35"
        Me.Button35.Size = New System.Drawing.Size(56, 40)
        Me.Button35.TabIndex = 29
        Me.Button35.Text = "AC"
        '
        'Button18
        '
        Me.Button18.BackColor = System.Drawing.Color.RosyBrown
        Me.Button18.Font = New System.Drawing.Font("Tahoma", 15.75!, System.Drawing.FontStyle.Bold)
        Me.Button18.Location = New System.Drawing.Point(280, 160)
        Me.Button18.Name = "Button18"
        Me.Button18.Size = New System.Drawing.Size(56, 40)
        Me.Button18.TabIndex = 25
        Me.Button18.Text = "*"
        '
        'Button19
        '
        Me.Button19.BackColor = System.Drawing.Color.LightSalmon
        Me.Button19.Font = New System.Drawing.Font("Tahoma", 12.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.Button19.Location = New System.Drawing.Point(152, 160)
        Me.Button19.Name = "Button19"
        Me.Button19.Size = New System.Drawing.Size(56, 40)
        Me.Button19.TabIndex = 24
        Me.Button19.Text = "MRC"
        '
        'Button20
        '
        Me.Button20.BackColor = System.Drawing.Color.LightSalmon
        Me.Button20.Font = New System.Drawing.Font("Tahoma", 15.75!, System.Drawing.FontStyle.Bold)
        Me.Button20.Location = New System.Drawing.Point(88, 160)
        Me.Button20.Name = "Button20"
        Me.Button20.Size = New System.Drawing.Size(56, 40)
        Me.Button20.TabIndex = 23
        Me.Button20.Text = "M-"
        '
        'Button21
        '
        Me.Button21.BackColor = System.Drawing.Color.LightSalmon
        Me.Button21.Font = New System.Drawing.Font("Tahoma", 15.75!, System.Drawing.FontStyle.Bold)
        Me.Button21.Location = New System.Drawing.Point(24, 160)
        Me.Button21.Name = "Button21"
        Me.Button21.Size = New System.Drawing.Size(56, 40)
        Me.Button21.TabIndex = 22
        Me.Button21.Text = "M+"
        '
        'Button25
        '
        Me.Button25.BackColor = System.Drawing.Color.RosyBrown
        Me.Button25.Font = New System.Drawing.Font("Tahoma", 15.75!, System.Drawing.FontStyle.Bold)
        Me.Button25.Location = New System.Drawing.Point(280, 208)
        Me.Button25.Name = "Button25"
        Me.Button25.Size = New System.Drawing.Size(56, 40)
        Me.Button25.TabIndex = 18
        Me.Button25.Text = "-"
        '
        'Button26
        '
        Me.Button26.BackColor = System.Drawing.Color.CadetBlue
        Me.Button26.Font = New System.Drawing.Font("Tahoma", 15.75!, System.Drawing.FontStyle.Bold)
        Me.Button26.Location = New System.Drawing.Point(152, 208)
        Me.Button26.Name = "Button26"
        Me.Button26.Size = New System.Drawing.Size(56, 40)
        Me.Button26.TabIndex = 17
        Me.Button26.Text = "9"
        '
        'Button27
        '
        Me.Button27.BackColor = System.Drawing.Color.CadetBlue
        Me.Button27.Font = New System.Drawing.Font("Tahoma", 15.75!, System.Drawing.FontStyle.Bold)
        Me.Button27.Location = New System.Drawing.Point(88, 208)
        Me.Button27.Name = "Button27"
        Me.Button27.Size = New System.Drawing.Size(56, 40)
        Me.Button27.TabIndex = 16
        Me.Button27.Text = "8"
        '
        'Button28
        '
        Me.Button28.BackColor = System.Drawing.Color.CadetBlue
        Me.Button28.Font = New System.Drawing.Font("Tahoma", 15.75!, System.Drawing.FontStyle.Bold)
        Me.Button28.Location = New System.Drawing.Point(24, 208)
        Me.Button28.Name = "Button28"
        Me.Button28.Size = New System.Drawing.Size(56, 40)
        Me.Button28.TabIndex = 15
        Me.Button28.Text = "7"
        '
        'Button11
        '
        Me.Button11.BackColor = System.Drawing.Color.RosyBrown
        Me.Button11.Font = New System.Drawing.Font("Tahoma", 15.75!, System.Drawing.FontStyle.Bold)
        Me.Button11.Location = New System.Drawing.Point(280, 256)
        Me.Button11.Name = "Button11"
        Me.Button11.Size = New System.Drawing.Size(56, 40)
        Me.Button11.TabIndex = 11
        Me.Button11.Text = "+"
        '
        'Button10
        '
        Me.Button10.BackColor = System.Drawing.Color.CadetBlue
        Me.Button10.Font = New System.Drawing.Font("Tahoma", 15.75!, System.Drawing.FontStyle.Bold)
        Me.Button10.Location = New System.Drawing.Point(152, 256)
        Me.Button10.Name = "Button10"
        Me.Button10.Size = New System.Drawing.Size(56, 40)
        Me.Button10.TabIndex = 10
        Me.Button10.Text = "6"
        '
        'Button9
        '
        Me.Button9.BackColor = System.Drawing.Color.CadetBlue
        Me.Button9.Font = New System.Drawing.Font("Tahoma", 15.75!, System.Drawing.FontStyle.Bold)
        Me.Button9.Location = New System.Drawing.Point(88, 256)
        Me.Button9.Name = "Button9"
        Me.Button9.Size = New System.Drawing.Size(56, 40)
        Me.Button9.TabIndex = 9
        Me.Button9.Text = "5"
        '
        'Button8
        '
        Me.Button8.BackColor = System.Drawing.Color.CadetBlue
        Me.Button8.Font = New System.Drawing.Font("Tahoma", 15.75!, System.Drawing.FontStyle.Bold)
        Me.Button8.Location = New System.Drawing.Point(24, 256)
        Me.Button8.Name = "Button8"
        Me.Button8.Size = New System.Drawing.Size(56, 40)
        Me.Button8.TabIndex = 8
        Me.Button8.Text = "4"
        '
        'Button4
        '
        Me.Button4.BackColor = System.Drawing.Color.RosyBrown
        Me.Button4.Font = New System.Drawing.Font("Tahoma", 15.75!, System.Drawing.FontStyle.Bold)
        Me.Button4.Location = New System.Drawing.Point(280, 304)
        Me.Button4.Name = "Button4"
        Me.Button4.Size = New System.Drawing.Size(56, 40)
        Me.Button4.TabIndex = 4
        Me.Button4.Text = "="
        '
        'Button3
        '
        Me.Button3.BackColor = System.Drawing.Color.CadetBlue
        Me.Button3.Font = New System.Drawing.Font("Tahoma", 15.75!, System.Drawing.FontStyle.Bold)
        Me.Button3.Location = New System.Drawing.Point(152, 304)
        Me.Button3.Name = "Button3"
        Me.Button3.Size = New System.Drawing.Size(56, 40)
        Me.Button3.TabIndex = 3
        Me.Button3.Text = "3"
        '
        'Button2
        '
        Me.Button2.BackColor = System.Drawing.Color.CadetBlue
        Me.Button2.Font = New System.Drawing.Font("Tahoma", 15.75!, System.Drawing.FontStyle.Bold)
        Me.Button2.Location = New System.Drawing.Point(88, 304)
        Me.Button2.Name = "Button2"
        Me.Button2.Size = New System.Drawing.Size(56, 40)
        Me.Button2.TabIndex = 2
        Me.Button2.Text = "2"
        '
        'Button1
        '
        Me.Button1.BackColor = System.Drawing.Color.CadetBlue
        Me.Button1.Font = New System.Drawing.Font("Tahoma", 15.75!, System.Drawing.FontStyle.Bold)
        Me.Button1.Location = New System.Drawing.Point(24, 304)
        Me.Button1.Name = "Button1"
        Me.Button1.Size = New System.Drawing.Size(56, 40)
        Me.Button1.TabIndex = 1
        Me.Button1.Text = "1"
        '
        'Label1
        '
        Me.Label1.AccessibleRole = System.Windows.Forms.AccessibleRole.Grip
        Me.Label1.BackColor = System.Drawing.Color.White
        Me.Label1.FlatStyle = System.Windows.Forms.FlatStyle.Popup
        Me.Label1.Font = New System.Drawing.Font("Trebuchet MS", 24.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.Label1.ForeColor = System.Drawing.Color.FromArgb(CType(0, Byte), CType(0, Byte), CType(192, Byte))
        Me.Label1.Location = New System.Drawing.Point(56, 48)
        Me.Label1.Name = "Label1"
        Me.Label1.Size = New System.Drawing.Size(248, 48)
        Me.Label1.TabIndex = 0
        Me.Label1.Text = "0"
        Me.Label1.TextAlign = System.Drawing.ContentAlignment.MiddleRight
        '
        'Button33
        '
        Me.Button33.BackColor = System.Drawing.Color.CadetBlue
        Me.Button33.Font = New System.Drawing.Font("Tahoma", 15.75!, System.Drawing.FontStyle.Bold)
        Me.Button33.Location = New System.Drawing.Point(216, 304)
        Me.Button33.Name = "Button33"
        Me.Button33.Size = New System.Drawing.Size(56, 40)
        Me.Button33.TabIndex = 31
        Me.Button33.Text = "0"
        '
        'CALCULATOR2007
        '
        Me.CALCULATOR2007.Icon = CType(resources.GetObject("CALCULATOR2007.Icon"), System.Drawing.Icon)
        Me.CALCULATOR2007.Text = "CALCULATOR2007"
        Me.CALCULATOR2007.Visible = True
        '
        'AxBalloonTipDemo1
        '
        Me.AxBalloonTipDemo1.Enabled = True
        Me.AxBalloonTipDemo1.Location = New System.Drawing.Point(293, -17)
        Me.AxBalloonTipDemo1.Name = "AxBalloonTipDemo1"
        Me.AxBalloonTipDemo1.OcxState = CType(resources.GetObject("AxBalloonTipDemo1.OcxState"), System.Windows.Forms.AxHost.State)
        Me.AxBalloonTipDemo1.Size = New System.Drawing.Size(37, 33)
        Me.AxBalloonTipDemo1.TabIndex = 4
        '
        'MainMenu1
        '
        Me.MainMenu1.MenuItems.AddRange(New System.Windows.Forms.MenuItem() {Me.MenuItem1})
        '
        'MenuItem1
        '
        Me.MenuItem1.Index = 0
        Me.MenuItem1.MenuItems.AddRange(New System.Windows.Forms.MenuItem() {Me.MenuItem2, Me.MenuItem3, Me.MenuItem4})
        Me.MenuItem1.Text = "&Help"
        '
        'MenuItem2
        '
        Me.MenuItem2.Index = 0
        Me.MenuItem2.Text = "Help topics"
        '
        'MenuItem3
        '
        Me.MenuItem3.Index = 1
        Me.MenuItem3.Text = "Help index"
        '
        'MenuItem4
        '
        Me.MenuItem4.Index = 2
        Me.MenuItem4.Text = "About calculator 2007"
        '
        'Form1
        '
        Me.AccessibleRole = System.Windows.Forms.AccessibleRole.Clock
        Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
        Me.BackColor = System.Drawing.Color.Black
        Me.ClientSize = New System.Drawing.Size(386, 515)
        Me.Controls.AddRange(New System.Windows.Forms.Control() {Me.AxBalloonTipDemo1, Me.GroupBox1, Me.Splitter1, Me.PictureBox1, Me.PictureBox2})
        Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle
        Me.HelpButton = True
        Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon)
        Me.MaximizeBox = False
        Me.Menu = Me.MainMenu1
        Me.Name = "Form1"
        Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
        Me.Text = "WELCOME TO CALCULATOR 2007"
        Me.GroupBox1.ResumeLayout(False)
        CType(Me.AxBalloonTipDemo1, System.ComponentModel.ISupportInitialize).EndInit()
        Me.ResumeLayout(False)

    End Sub

#End Region

    Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
        Static intx As Integer = Me.PictureBox2.Left
        Static inty As Integer = Me.PictureBox2.Top
        Static intwidth As Integer = Me.PictureBox2.Width
        Static intheight As Integer = Me.PictureBox2.Height

        intx -= 10
        If intx <= -Me.PictureBox2.Width Then
            intx = Me.Width
        End If
        Me.PictureBox2.SetBounds(intx, inty, intwidth, intheight)
    End Sub



    Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.Tick
        Dim x As Integer
        Dim y As Integer
        x = Me.Width
        y = Me.PictureBox1.Left
        If y >= x Then
            Me.PictureBox1.Left = -136
        End If
        Me.PictureBox1.Left += 10
    End Sub

    Private Sub CALCULATOR2007_Mousemove(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles CALCULATOR2007.MouseMove
        Me.AxBalloonTipDemo1.ShowTip()
        Me.AxBalloonTipDemo1.TipText = "YOU ARE USING CALCULATOR"
        Me.AxBalloonTipDemo1.TitleText = "CALCULATOR 2007"
    End Sub

   
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        If Len(Me.Label1.Text) >= 12 Then

        ElseIf STR = "0" Then
            STR = "1"
        Else
            STR = STR + "1"
        End If
        Me.Label1.Text = STR
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        If Len(Me.Label1.Text) >= 12 Then

        ElseIf STR = "0" Then
            STR = "2"
        Else
            STR = STR + "2"
        End If
        Me.Label1.Text = STR
    End Sub

    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
        If Len(Me.Label1.Text) >= 12 Then

        ElseIf STR = "0" Then
            STR = "3"
        Else
            STR = STR + "3"
        End If
        Me.Label1.Text = STR
    End Sub

    Private Sub Button8_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button8.Click
        If Len(Me.Label1.Text) >= 12 Then

        ElseIf STR = "0" Then
            STR = "4"
        Else
            STR = STR + "4"
        End If
        Me.Label1.Text = STR
    End Sub

    Private Sub Button9_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button9.Click
        If Len(Me.Label1.Text) >= 12 Then

        ElseIf STR = "0" Then
            STR = "5"
        Else
            STR = STR + "5"
        End If
        Me.Label1.Text = STR
    End Sub

    Private Sub Button10_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button10.Click
        If Len(Me.Label1.Text) >= 12 Then

        ElseIf STR = "0" Then
            STR = "6"
        Else
            STR = STR + "6"
        End If
        Me.Label1.Text = STR
    End Sub

    Private Sub Button28_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button28.Click
        If Len(Me.Label1.Text) >= 12 Then

        ElseIf STR = "0" Then
            STR = "7"
        Else
            STR = STR + "7"
        End If
        Me.Label1.Text = STR
    End Sub

    Private Sub Button27_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button27.Click
        If Len(Me.Label1.Text) >= 12 Then

        ElseIf STR = "0" Then
            STR = "8"
        Else
            STR = STR + "8"
        End If
        Me.Label1.Text = STR
    End Sub

    Private Sub Button26_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button26.Click
        If Len(Me.Label1.Text) >= 12 Then

        ElseIf STR = "0" Then
            STR = "9"
        Else
            STR = STR + "9"
        End If
        Me.Label1.Text = STR
    End Sub

    ' Private Sub Button33_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button33.Click
    '    If Len(Me.Label1.Text) >= 12 Then
    '
    '       ElseIf STR = "0" Then
    '          STR = "0"
    '     ElseIf Right(Me.Label1.Text, 1) = "." Then
    '        STR = STR + "0"
    '   End If
    '  Me.Label1.Text = STR
    'End Sub

    Private Sub Button11_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button11.Click
        temp = STR
        STR = "0"
        int = 1
    End Sub

    Private Sub Button25_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button25.Click
        temp = STR
        STR = "0"
        int = 2
    End Sub

    Private Sub Button18_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button18.Click
        temp = STR
        STR = "0"
        int = 3
    End Sub

    Private Sub Button32_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button32.Click
        temp = STR
        STR = "0"
        int = 4
    End Sub

    Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
        If int = 1 Then
            STR = CStr(CInt(STR) + CInt(temp))
        ElseIf int = 2 Then
            STR = CStr(CInt(temp) - CInt(STR))
        ElseIf int = 3 Then
            STR = CStr(CInt(STR) * CInt(temp))
        ElseIf int = 4 Then
            STR = CStr(CInt(STR) / CInt(temp))
        End If
        Me.Label1.Text = STR
        int = 0
    End Sub

    Private Sub Button7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button7.Click
        STR = CStr(CInt(STR) * -1)
        Me.Label1.Text = STR
    End Sub

    Private Sub Button21_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button21.Click
        mmy = CStr(CInt(mmy) + CInt(Me.Label1.Text))
        STR = "0"
        If mmy = "0" Then
            Me.Label2.Text = ""
        Else
            Me.Label2.Text = "MEMORY"
        End If
    End Sub

    Private Sub Button20_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button20.Click
        mmy = CStr(CInt(mmy) - CInt(Me.Label1.Text))
        STR = "0"
        If mmy = "0" Then
            Me.Label2.Text = ""
        Else
            Me.Label2.Text = "MEMORY"
        End If
    End Sub

    Private Sub Button35_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button35.Click
        STR = "0"
        temp = "0"
        mmy = "0"
        int = 0
        Me.Label1.Text = "0"
        Me.Label2.Text = ""
    End Sub

    Private Sub Button19_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button19.Click
        Me.Label1.Text = mmy
        STR = "0"
    End Sub

    Private Sub Button33_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button33.Click
        If STR = "0" Then
            STR = "0"
        Else
            STR = STR + "0"

        End If
        Me.Label1.Text = STR
    End Sub

    Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click
        If STR = "0" Then
            STR = "0"
        Else
            STR = STR + "00"

        End If
        Me.Label1.Text = STR
    End Sub

    Private Sub Button12_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button12.Click

    End Sub

    Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
        'STR = CStr(sqrt(CInt(Me.Label1.Text)))
    End Sub

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

    End Sub
End Class



'make sure all the controls are taken in the form.
'Please reply how you like our service
'Please reply to [email protected]


Download this snippet    Add to My Saved Code

VB.NET Calculator Comments

No comments have been posted about VB.NET Calculator. Why not be the first to post a comment about VB.NET Calculator.

Post your comment

Subject:
Message:
0/1000 characters