Henry's MathTextBox

Henry's MathTextBox is a product of Henry's Software

 


1.0

Summary

This UserControl lets you evaluate basic formulas/equations EX: ((3.14 / 180) * 60) * 22.5.

There is also 217 value conversions EX: Convert Byte, Kilobyte, Megabyte, Gigabyte, Terabyte, Petabyte, Exabyte

 

MathTextBox Settings

  • Enable Enter Key
  • Hide Evaluation Button
  • Set Evaluation Button Text
1
2
3
4
'Settings
        mtb1.EnableEnterKey = True
        mtb1.HideEvaluationButton = False
        mtb1.SetEvaluationButtonText = "="

 

How to use MathTextBox

1
Imports MathTextBox.Conversions
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
'This event shows the returned value from the formulas/equations
                                        Private Sub mtb1_MathEvaluationEvent(EvaluatedString As String) Handles mtb1.MathEvaluationEvent
        MsgBox(EvaluatedString)
                                        End Sub
                                        'Evaluation samples
                                        Private Sub Button_Click(sender As Object, e As RoutedEventArgs)
        mtb1.EvaluateFormula1()
        MsgBox(mtb1.ReturnedValue, MsgBoxStyle.Information)
                                        'Or
                                        'Evaluate Formula with out using MathTextBox
        MsgBox(mtb1.EvaluateFormula2("((3.14 / 180) * 60) * 22.5"), MsgBoxStyle.Information)
                                        End Sub

 

How to use Conversions

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
'Convert Bytes
                                        Private Sub Button_Click_1(sender As Object, e As RoutedEventArgs)
                                        'Convert Bytes. Byte, Kilobyte, Megabyte, Gigabyte, Terabyte, Petabyte, Exabyte
                                        ' 1                    '= 1 Byte
                                        ' 1024                 '= 1 KB
                                        ' 1048576              '= 1 MB
                                        ' 1073741824           '= 1 GB
                                        ' 1099511627776        '= 1 TB
                                        ' 1125899906842624     '= 1 PB
                                        ' 1152921504606847000  '= 1 EB
        MsgBox(ConvertBytes(1048576), MsgBoxStyle.Information, "Megabyte") 'This is 1 Megabyte
        MsgBox(ConvertBytes(1099511627776), MsgBoxStyle.Information, "Terabyte") 'This is 1 Terabyte
                                        End Sub

 

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
Private Sub Button_Click_2(sender As Object, e As RoutedEventArgs)
        MsgBox(PressureConversion(1, Pressure.PSI, Pressure.Kilopascal), MsgBoxStyle.Information, "Pressure")
        MsgBox(SpeedVelocity(1, SPEED_VELOCITY.Kilometer_Hour, SPEED_VELOCITY.Miles_Hour), MsgBoxStyle.Information, "Speed, Velocity")
        MsgBox(LiquidConversion(1, Liquid.Gallons_US, Liquid.Ounces), MsgBoxStyle.Information, "Liquid")
        MsgBox(WeightConversion(1, Weight.Pounds, Weight.Ounces), MsgBoxStyle.Information, "Weight")
        MsgBox(AreaConversion(1, Area.SquareFeet, Area.SquareInches), MsgBoxStyle.Information, "Area")
        MsgBox(LengthConversion(0.5, Length.Inches, Length.Feet), MsgBoxStyle.Information, "Length")
        MsgBox(TemperatureConversion(32, Temperature.Celsius, Temperature.Fahrenheit), MsgBoxStyle.Information, "Temperature")
        MsgBox(VolumeConversion(0.01, Volume.CubicFeet, Volume.CubicMeters), MsgBoxStyle.Information, "Volume")
        MsgBox(FractionToDecimal("9/5"), MsgBoxStyle.Information, "Fraction To Decimal")
        MsgBox(DecimalToFraction(1.8), MsgBoxStyle.Information, "Decimal To Fraction")
        MsgBox(Velocity_Of_Water_In_a_Pipe1(4, 11.3), MsgBoxStyle.Information, "Velocity Of Water")
        MsgBox(Velocity_Of_Water_In_a_Pipe2(4, 50), MsgBoxStyle.Information, "Velocity Of Water")
                                        End Sub