Click here to Skip to main content
15,884,628 members
Articles / Programming Languages / C#

A Calculation Engine for .NET

Rate me:
Please Sign up or sign in to vote.
4.92/5 (183 votes)
1 Sep 2013Public Domain15 min read 647.4K   11.4K   421  
A calculation engine that is small, fast, and extensible.
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class Form1
    Inherits System.Windows.Forms.Form

    'Form overrides dispose to clean up the component list.
    <System.Diagnostics.DebuggerNonUserCode()> _
    Protected Overrides Sub Dispose(ByVal disposing As Boolean)
        Try
            If disposing AndAlso components IsNot Nothing Then
                components.Dispose()
            End If
        Finally
            MyBase.Dispose(disposing)
        End Try
    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.
    <System.Diagnostics.DebuggerStepThrough()> _
    Private Sub InitializeComponent()
        Me._txtExpression = New System.Windows.Forms.TextBox()
        Me._btnEval = New System.Windows.Forms.Button()
        Me.Label1 = New System.Windows.Forms.Label()
        Me.Label2 = New System.Windows.Forms.Label()
        Me._lblResult = New System.Windows.Forms.Label()
        Me.SuspendLayout()
        '
        '_txtExpression
        '
        Me._txtExpression.Location = New System.Drawing.Point(99, 12)
        Me._txtExpression.Name = "_txtExpression"
        Me._txtExpression.Size = New System.Drawing.Size(186, 22)
        Me._txtExpression.TabIndex = 0
        '
        '_btnEval
        '
        Me._btnEval.Location = New System.Drawing.Point(99, 53)
        Me._btnEval.Name = "_btnEval"
        Me._btnEval.Size = New System.Drawing.Size(123, 37)
        Me._btnEval.TabIndex = 1
        Me._btnEval.Text = "Calculate"
        Me._btnEval.UseVisualStyleBackColor = True
        '
        'Label1
        '
        Me.Label1.AutoSize = True
        Me.Label1.Location = New System.Drawing.Point(12, 15)
        Me.Label1.Name = "Label1"
        Me.Label1.Size = New System.Drawing.Size(81, 17)
        Me.Label1.TabIndex = 2
        Me.Label1.Text = "E&xpression:"
        '
        'Label2
        '
        Me.Label2.AutoSize = True
        Me.Label2.Location = New System.Drawing.Point(12, 116)
        Me.Label2.Name = "Label2"
        Me.Label2.Size = New System.Drawing.Size(52, 17)
        Me.Label2.TabIndex = 3
        Me.Label2.Text = "Result:"
        '
        '_lblResult
        '
        Me._lblResult.AutoSize = True
        Me._lblResult.Location = New System.Drawing.Point(96, 116)
        Me._lblResult.Name = "_lblResult"
        Me._lblResult.Size = New System.Drawing.Size(0, 17)
        Me._lblResult.TabIndex = 3
        '
        'Form1
        '
        Me.AcceptButton = Me._btnEval
        Me.AutoScaleDimensions = New System.Drawing.SizeF(8.0!, 16.0!)
        Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
        Me.ClientSize = New System.Drawing.Size(483, 256)
        Me.Controls.Add(Me._lblResult)
        Me.Controls.Add(Me.Label2)
        Me.Controls.Add(Me.Label1)
        Me.Controls.Add(Me._btnEval)
        Me.Controls.Add(Me._txtExpression)
        Me.Name = "Form1"
        Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
        Me.Text = "Form1"
        Me.ResumeLayout(False)
        Me.PerformLayout()

    End Sub
    Friend WithEvents _txtExpression As System.Windows.Forms.TextBox
    Friend WithEvents _btnEval As System.Windows.Forms.Button
    Friend WithEvents Label1 As System.Windows.Forms.Label
    Friend WithEvents Label2 As System.Windows.Forms.Label
    Friend WithEvents _lblResult As System.Windows.Forms.Label

End Class

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under A Public Domain dedication


Written By
Software Developer
Brazil Brazil
Software Architect/Developer with several years experience creating and delivering software.

Full-stack Web development (including React, Firebase, TypeScript, HTML, CSS), Entity Framework, C#, MS SQL Server.

Passionate about new technologies and always keen to learn new things as well as improve on existing skills.

Comments and Discussions