Results 1 to 3 of 3

Thread: [RESOLVED] masked input box not accepting all data

  1. #1

    Thread Starter
    New Member
    Join Date
    Jul 2008
    Posts
    6

    Resolved [RESOLVED] masked input box not accepting all data

    hello,

    i have a question about masked input boxes. I have included one in a numeric keypad project i have created in which the user's input is entered into a masked input box, with formatting of type: 000-0000.

    My problem is: when i run the program, i find that it places the input from my numeric button clicks into only the right portion (the 4 numbers to the right of the dash: i.e., -0000) and stops displaying any input after 4 numbers. As i desire to have input for a 7-digit phone number, this is frustrating that it's not working. Anything I might be doing wrong? I haven't altered anything in the Properties window; i have merely added the masked text box to my Form and added the masked input data field directly from the masked text box button.

    thanks to anyone who has any insight on this matter!

    Code:

    Public Class frmNumberToDial

    Private Sub btnShow_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnShow.Click
    Dim secondForm As New PushButtons()
    secondForm.showdialog()
    mtxtResults.Text = secondForm.output
    End Sub
    End Class
    Public Class PushButtons

    Public output As String


    Private Sub btnEnter_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnEnter.Click
    output = mtxtEnter.Text
    Me.Close()
    End Sub

    Private Sub btnClear_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnClear.Click
    mtxtEnter.Text = ""
    End Sub

    Private Sub btn1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn1.Click
    mtxtEnter.Text += CStr(1)
    End Sub

    Private Sub btn2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn2.Click
    mtxtEnter.Text += CStr(2)
    End Sub

    Private Sub btn3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn3.Click
    mtxtEnter.Text += CStr(3)
    End Sub

    Private Sub btn4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn4.Click
    mtxtEnter.Text += CStr(4)
    End Sub

    Private Sub btn5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn5.Click
    mtxtEnter.Text += CStr(5)
    End Sub

    Private Sub btn6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn6.Click
    mtxtEnter.Text += CStr(6)
    End Sub

    Private Sub btn7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn7.Click
    mtxtEnter.Text += CStr(7)
    End Sub

    Private Sub btn8_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn8.Click
    mtxtEnter.Text += CStr(8)
    End Sub

    Private Sub btn9_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn9.Click
    mtxtEnter.Text += CStr(9)
    End Sub

    Private Sub btnAsterisk_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAsterisk.Click
    mtxtEnter.Text += "*"
    End Sub

    Private Sub btnZero_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnZero.Click
    mtxtEnter.Text += CStr(0)
    End Sub

    Private Sub btnPound_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnPound.Click
    mtxtEnter.Text += "#"
    End Sub
    End Class

    thanks to anyone who has any insight on this matter!

  2. #2

    Thread Starter
    New Member
    Join Date
    Jul 2008
    Posts
    6

    Smile Re: masked input box not accepting all data

    i have solved my own problem:

    in the Properties window in the Form Designer, you have to have the field called 'TestMaskFormat' set to Exclude Prompt and Literals.

    (Things they don't tell you in the book! LOL)

    (I'm using Visual Basic 2008 Express)

  3. #3
    Addicted Member
    Join Date
    Aug 2007
    Location
    Miami, FL USA
    Posts
    171

    Re: [RESOLVED] masked input box not accepting all data

    This is just a guess, but it looks like the maskedtextbox is waiting for the “-“ input. Maybe because you are typing the text directly into the maskedtextbox.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width