3
Contributors
4
Replies
5
Views
6 Years
Discussion Span
Last Post by M.Waqas Aslam
0

use MASK text box and set the pattern of phone number you want. you can also set ur custom format if you want...

0

there's no MASK in the properties. I think in visual basic there's one, but there's no mask in vb net 2010

0

never mind, i found the solution. you have to add the MaskTextBox from the toolbox. :P

0

hello aishapot !

you can use substring functions , for example you have number 1234567890

Dim p1, p2, p3, p4 As String
        If TextBox1.Text.Length = 10 Then
            p1 = TextBox1.Text.Substring(0, 3)
            p2 = TextBox1.Text.Substring(3, 3)
            p3 = TextBox1.Text.Substring(6, 2)
            p4 = TextBox1.Text.Substring(8, 2)
            TextBox1.Text = "(" & p1 & ")" & p2 & "-" & p3 & "-" & p4
        End If
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.