|
-
Apr 22nd, 2006, 04:24 PM
#1
Thread Starter
Junior Member
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,
-
Apr 22nd, 2006, 04:32 PM
#2
Re: Phone keypad
Here you go 
VB Code:
Private Sub cmdcall_Click()
If Len(lbldisplay) < 4 Then
MsgBox "Please enter a valid phone number"
cmdend.Enabled = True
Exit Sub
End If
cmdend.Enabled = True
lstlist1.AddItem lbldisplay
End Sub
Try this. Hope it works out 
Jenova
-
Apr 22nd, 2006, 04:45 PM
#3
Thread Starter
Junior Member
Re: Phone keypad
 Originally Posted by Jenova
Here you go
VB Code:
Private Sub cmdcall_Click()
If Len(lbldisplay) < 4 Then
MsgBox "Please enter a valid phone number"
cmdend.Enabled = True
Exit Sub
End If
cmdend.Enabled = True
lstlist1.AddItem lbldisplay
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
-
Apr 22nd, 2006, 04:53 PM
#4
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:
Private Sub cmdCall_Click()
If Len(Text1.Text) < 4 Then
MsgBox "Please enter a valid phone number"
cmdEnd.Enabled = True
Exit Sub
End If
cmdEnd.Enabled = True
List1.AddItem "Un-named - " & Text1.Text
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|