Private Sub GenerateButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles GenerateButton.Click
Dim i As String = PhoneNumberTextBox.Text
Dim one As Integer = i.Substring(0, 1) 'Remove each digit
Dim two As Integer = i.Substring(1, 1)
Dim three As Integer = i.Substring(2, 1)
Dim four As Integer = i.Substring(3, 1)
Dim five As Integer = i.Substring(4, 1)
Dim six As Integer = i.Substring(5, 1)
Dim seven As Integer = i.Substring(6, 1)
calculate(one)
calculate(two)
End Sub
Function calculate(ByVal number As Integer)
If number = 1 Or 0 Then
MessageBox.Show(" Please input numbers between 2 to 9 ")
ElseIf number = 2 Then
For r As Integer = 0 To array1.GetUpperBound(0)
Dim array1(,) As String = {{"A", " B", " C"}, {"D", " E", " F"}, _
{"G", " H", " I"}, {"J", " K", " L"}, {"M", " N", " O"}, _
{"P", " R", " S"}, {"T", " U", " V"}, {"W", " X", " Y"}}
For i As Integer = 0 To array1.GetUpperBound(1)
' PhoneNumberWordsListBox.Items.Add(array1(0, i))
For number1 As Integer = 0 To array1.GetUpperBound(0)
' PhoneNumberWordsListBox.Items.Add(array1(0, i))
' TextBox1.AppendText(vbCrLf & array1(0, i))
Next
Next
Next
Return number
End Function
هومان 0 Newbie Poster
Reverend Jim 4,966 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.