textboxes formar

Posted on 2006-05-23
Last Modified: 2007-12-19
i would like to have like a mask in the textbox, how can i do???

i have this number in the textbox 45678.90, i would like this format 45,678.90 when the lostfocus of the textbox.
Question by:losoeos
    LVL 62

    Accepted Solution

    Hi losoeos;

    This code will do it for you.

        Private Sub TextBox1_LostFocus(ByVal sender As Object, _
            ByVal e As System.EventArgs) Handles TextBox1.LostFocus

            Dim valueStr As String = TextBox1.Text
            Dim value As Double

            If Not IsNumeric(valueStr) Then
                MessageBox.Show("Text box value is in the wrong format")
                value = Double.Parse(valueStr)
                TextBox1.Text = value.ToString("N")
            End If

        End Sub

    LVL 2

    Expert Comment

    by:anwar ul haque
    User this control AMS.TextBox.dll instead, and it will give you propery DigitsInGroup set its value to 3. You can find more information from here
    Hope this will help
    Anwar ul Haque
    LVL 62

    Expert Comment

    by:Fernando Soto
    Hi Bob;

    I would like to see a resolution to this question as I posted a working solution.



    Featured Post

    Threat Intelligence Starter Resources

    Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

    Join & Write a Comment

    Suggested Solutions

    Well, all of us have seen the multiple EXCEL.EXE's in task manager that won't die even if you call the .close, .dispose methods. Try this method to kill any excels in memory. You can copy the kill function to create a check function and replace the …
    If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
    This video discusses moving either the default database or any database to a new volume.
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    728 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now