' Optional ByVal GroupDigits As TriState = TriState.UseDefault) As String ' Optional ByVal UseParensForNegativeNumbers As TriState = TriState.UseDefault, _ ' Optional ByVal IncludeLeadingDigit As TriState = TriState.UseDefault, _ ' Optional ByVal NumDigitsAfterDecimal As Integer = -1, _ ' Function FormatNumber(ByVal Expression As Object, _ Private Sub XTextBox_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.TextChanged
' Me.Text = Decimal.Parse(Me.Text).ToString("c") 'Private Sub XTextBox_Validated(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Validated Me.BackColor = SystemColors.Control 'changed on Private Sub XTextBox_Leave(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Leave Private Sub XTextBox_Enter(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Enter ' If Not IsNumeric(e.Ke圜har) And Asc(e.Ke圜har) 8 And Asc(e.Ke圜har) 46 Then 'Private Sub XTextBox_KeyPress1(ByVal sender As Object, ByVal e As ) Public Shadows Property TextAlign As HorizontalAlignment Protected Overrides Sub OnCreateControl() Private _Font As Font = New Font("Consolas", 9, FontStyle.Regular) Select(, 0)Īctivated Delete key which will delete all the number already pressedĪnd before pressing decimal key all the key pressed will be whole numberĪnd after pressing the decimal key two number can be pressed for decimal " & strCurrency.Substring(strCurrency.Length - 2) TextBox1.Text = strCurrency.Substring( 0, strCurrency.Length - 2) & ".
TextBox1.Text = " " ElseIf strCurrency.Length = 1 Then StrCurrency = strCurrency.Substring( 0, strCurrency.Length - 1) If (e.Ke圜ode >= Keys.D0 And e.Ke圜ode = Keys.NumPad0 And e.Ke圜ode 0 Then
VB6 FORMAT STRING TO CURRENCY CODE
Copy Code Dim strCurrency As String = " " Dim acceptableKey As Boolean = False Private Sub TextBox1_KeyDown( ByVal sender As Object, ByVal e As ) Handles TextBox1.KeyDown