Results 1 to 4 of 4

Thread: Phone keypad

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Apr 2006
    Posts
    27

    Phone keypad

    Hi All,

    Im in the middle of making a simple mobile phone in vb, but im stuck on a few things -

    1, I have two frames, one has a number keypad and a display, and the other frame is for where I want to store numbers entered. I have a listbox. At the moment i am able to store numbers in the listbox, but i need to be able to add a number using the call button which also adds a name of "unnamed" in listbox. Also i am not letting the user add less than 3 numbers when call is pressed, the msgbox comes up saying enter a vaild number but it is still adding it to the listbox.

    Private Sub cmdcall_Click()
    If Len(lbldisplay) < 4 Then
    MsgBox "Please enter a valid phone number"
    cmdend.Enabled = True
    End If
    cmdend.Enabled = True

    lstlist1.AddItem lbldisplay

    End Sub


    2, As you already know i have two frames, i want to be able to press a command button on the keypad which loads up the the phonebook, is this possible??

    any help would be helpful thanks,

  2. #2
    Hyperactive Member Jenova's Avatar
    Join Date
    Feb 2006
    Location
    Googleplex
    Posts
    413

    Re: Phone keypad

    Here you go

    VB Code:
    1. Private Sub cmdcall_Click()
    2.     If Len(lbldisplay) < 4 Then
    3.        MsgBox "Please enter a valid phone number"
    4.        cmdend.Enabled = True
    5.        Exit Sub
    6.     End If
    7.     cmdend.Enabled = True
    8.  
    9.     lstlist1.AddItem lbldisplay
    10. End Sub

    Try this. Hope it works out

    Jenova

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Apr 2006
    Posts
    27

    Re: Phone keypad

    Quote Originally Posted by Jenova
    Here you go

    VB Code:
    1. Private Sub cmdcall_Click()
    2.     If Len(lbldisplay) < 4 Then
    3.        MsgBox "Please enter a valid phone number"
    4.        cmdend.Enabled = True
    5.        Exit Sub
    6.     End If
    7.     cmdend.Enabled = True
    8.  
    9.     lstlist1.AddItem lbldisplay
    10. End Sub

    Try this. Hope it works out

    Jenova
    Thank u very much cant bellieve all i had to put was Exit Sub, just the rest to work out now

  4. #4
    Hyperactive Member Jenova's Avatar
    Join Date
    Feb 2006
    Location
    Googleplex
    Posts
    413

    Re: Phone keypad

    but i need to be able to add a number using the call button which also adds a name of "unnamed" in listbox.
    Not sure why you are using a label. Is that what you mean. I just replaced the label with a textbox.

    VB Code:
    1. Private Sub cmdCall_Click()
    2.     If Len(Text1.Text) < 4 Then
    3.        MsgBox "Please enter a valid phone number"
    4.        cmdEnd.Enabled = True
    5.        Exit Sub
    6.     End If
    7.     cmdEnd.Enabled = True
    8.  
    9.     List1.AddItem "Un-named - " & Text1.Text
    10. End Sub

    Hope this helps

    Jenova

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