This question asks me to code the remove dashes button so that it first verifies that the social security number contains exactly 11 characters. It then should remove the dashes from the social security number for displaying the number in the xNumberLabel. Use the remove method to remove the dashes. This is my code but it doesn't work for me:
CODE
' Project name: Social Security Project
' Project purpose: The project removes the dashes
' from a social security number.
' Created/revised: <Mark Parsons> on <April 11, 2008>
Option Explicit On
Option Strict On
Public Class MainForm
Private Sub xExitButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles xExitButton.Click
Me.Close()
End Sub
Private Sub xNumberTextBox_Enter(ByVal sender As Object, ByVal e As System.EventArgs) Handles xNumTextBox.Enter
Me.xNumTextBox.SelectAll()
End Sub
Private Sub xRemoveButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles xRemoveButton.Click
' removes the dashes from a social security number
Dim SSNum As String
Dim NewSSNum As String
SSNum = Me.xNumTextBox.Text
Do Until SSNum.Length = 11
SSNum = Me.xNumTextBox.Text
Loop
NewSSNum = SSNum.Trim("-"c)
NewSSNum = Me.xNumLabel.Text
Me.xNumTextBox.Focus()
End Sub
End Class
Can anyone help? Please