Imports System.Collections.Generic
Imports System.ComponentModel
Imports System.Globalization
Imports System.Data
Imports System.Drawing
Imports System.Text
Imports System.Windows.Forms
Imports PopCalc.Library
Namespace PopCalc.Test
Public Partial Class Form1
Inherits Form
Public Sub New()
InitializeComponent()
End Sub
Private Sub m_BoxParse_CalculatorParse(sender As Object, e As CalculatorParseEventArgs)
Dim c As CultureInfo = CultureInfo.CurrentCulture
Dim cs As String = c.NumberFormat.CurrencySymbol
Dim ns As String = c.NumberFormat.NegativeSign
Dim parsed As String = e.Original
If parsed.Contains(cs) Then
parsed = parsed.Replace(cs, "")
End If
If parsed.StartsWith("(") AndAlso parsed.EndsWith(")") Then
parsed = ns & parsed.Replace("(", "").Replace(")", "")
End If
e.Parsed = parsed
End Sub
Private Sub m_BoxParse_CalculatorFormat(sender As Object, e As CalculatorFormatEventArgs)
e.FormattedResult = e.Result.ToString("c")
End Sub
End Class
End Namespace