Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  HOME    TRACKER    Visual Basic



im making a keypad to insert 5 numbers into a text box, a bit like a touch screen wher you enter your 5 digit security code.

i can make it put a nuumber in - if you press '1' it inserts '1' into the text box, but then if you press the next digit , say '2', it wont place a '2' AFTER it. it clears the box and puts a '2' in.

anyone know how to say AFTER the first digit place this, then AFTER the second place the third etc?
many thanks


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
F10 Keypad
Dear All,

Why can't I use F10 keypad while I run my VB code ?
Everytime I press F10, it always point to menu at my MDI Form.

Is there anyway I can use this keypad ?

Since I've used all Fn keypad (F1 - F12, except F10), I need to use this stupid F10.

I'd be greatful to have any kinda help


NUmeric Keypad
What do i have to use with the sendkeys function to simulate a pressing of the numbers 1-10 on the numeric keypad?

Using The Keypad In An Application
I am creating a program for a research project. I have a usb key pad (number pad) that is used as my input. I need to know how to have something happen when a certain key is pressed. The simpiler the better.



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,

Onscreen Keypad
i have designed a program in which a keypad on the screen is needed, it should act like the keypad on a calculator, where if you press 5 then 4 then 5 then 9 the value should be 5459. i have been able to do this with strings by just appending the new value to the end of the string, but i cant figure out how to do this with numbers.

Keypad Problem
On a VB6 form, it shows a keypad for numeric input similar to a calculator. The form is made by buttons (0-9, period, backspace, cancel, enter, etc.) and it shows the number input in a label.

Then in Form_KeyDown routine, it detects 48 to 57 keycodes to catch the keyboard keys 0 to 9 and also shows in the label box. However, it doesn't work for the keypad on keyboard. Then I checked for those keycode (or ASCII), when the Num Lock was on, they were 96 to 105 for 0 to 9. However, when I checked with an ASCII table, 96 to 105 represented ' and a to i. Why was that? If I just go ahead and put 48 to 57 and 96 to 105 for digit 0 to 9, will there be any potential problems?

Keypad Code
I have a calculator vb coded that needs to be operated via keypad from the keyboard also. how can i achieve this?

Skill is successfully walking a tightrope over Niagara Falls. Intelligence is not trying.

KeyPad Emulation
hi all out there

pls check the foll code
i want that when the numpad keys are pressed the corresponding number shud be displayed in a text box . but m not getting it
what can be the problem?? also the decimal.A,L and enter keys need to work
let me know

Code:Private Sub cmdNumPad_Click(Index As Integer)

    blnKeyPad = False
    blnPrepayMode = False
    Select Case Index
        Case 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 ' If 0 to 9 is clicked the index is passed to the text box
            txtNumber.BackColor = vbGreen
            If cmdNumPad(12).Enabled = True Then cmdNumPad(12).Enabled = False
            If cmdNumPad(13).Enabled = True Then cmdNumPad(13).Enabled = False
            txtNumber = txtNumber & Index
        Case 10 ' Decimal point
            txtNumber.BackColor = vbGreen
            If cmdNumPad(12).Enabled = True Then cmdNumPad(12).Enabled = False
            If cmdNumPad(13).Enabled = True Then cmdNumPad(13).Enabled = False
            txtNumber = txtNumber & "."
        Case 12
            txtNumber.BackColor = vbGreen
            txtNumber = txtNumber & "A"
            cmdNumPad(13).Enabled = False
        Case 13
            txtNumber.BackColor = vbGreen
            txtNumber = txtNumber & "L"
            cmdNumPad(12).Enabled = False
        Case 14
            txtNumber.BackColor = vbNormal
            txtNumber.Text = ""
            cmdNumPad(11).Enabled = True
            cmdNumPad(12).Enabled = True
            cmdNumPad(13).Enabled = True
        Case 11
            txtNumber.BackColor = vbGreen
            blnKeyPad = True
            blnPrepayMode = True
            cmdNumPad(11).Enabled = False
        Case 15
            cmdNumPad(11).Enabled = True
            cmdNumPad(12).Enabled = True
            cmdNumPad(13).Enabled = True
            If Len(txtNumber.Text) <> 0 Then
                If Len(txtNumber.Text) = 1 Then
                    txtNumber.Text = ""
                    txtNumber.Text = Mid(txtNumber.Text, 1, Len(txtNumber.Text) - 1)
                End If
            End If

    End Select
End Sub
Private Sub txtNumber_KeyPress(KeyAscii As Integer)
Dim sKey As String
    sKey = Chr$(KeyAscii)

    Select Case sKey
    Case "1"
        cmdNumPad_Click 1
    Case "2"
        cmdNumPad_Click 2
    Case "3"
        cmdNumPad_Click 3
    Case "4"
        cmdNumPad_Click 4
    Case "5"
        cmdNumPad_Click 5
    Case "6"
        cmdNumPad_Click 6
    Case "7"
        cmdNumPad_Click 7
    Case "8"
        cmdNumPad_Click 8
    Case "9"
        cmdNumPad_Click 9
    Case "0"
        cmdNumPad_Click 0
    Case "."
        cmdNumPad_Click 10 'decimal
    Case vbBack
        cmdNumPad_Click 15
    Case "L" 'L
        cmdNumPad_Click 13
    Case "A"
        cmdNumPad_Click 12 'A
    Case vbCr, vbCrLf
        cmdNumPad_Click 11
    End Select

End Sub

Skill is successfully walking a tightrope over Niagara Falls. Intelligence is not trying.

Mobile Phone Keypad In Vb6

Does anyone know about any vb6 that runs/works as a mobile?

I mean:

Key from 0 to 9....

If someone touches "2" the A comes. If you dont type during two seconds the "A" keeps stayig there and the cursor goes ahead. If you touch during those two seconds the key "1" turns it into "B" again...etc

So....a mobile but in a VB6.

Kind Regards.

p.s..Could you send even an example on a couple of keys...the "1" or "2"

Decimal Key In Numeric Keypad

In numeric keypad the decimal point key is always a dot (.)
What if I change the regional settings for example to Greek where the decimal point is comma (,)? I get dot(.)

How can I change that key to send comma or dot , depending the regional settings?
I know that I can preview the keypress in each form of my application and change the dot to comma but what if I have 16+ applications with 20+ forms.

Thanks in advance

Phone Keypad - Strings
basically i'm making a very simply phone keypad in VB.
first things first: would the display work better as a label or text box?
second: how can i make it so when i press a number it appears in the textbox/label?
and third: i need the numbers to stay in the textbox/label such as, if i click the "1" button, a one appears, and then when i click the "2" button the display now reads "12" instead of deleting the one and replacing it with a 2! How?

i know this is basic stuff but it's my first time using VB and i'm hopelessly lost.


Sound On Security Keypad.
Okay. First, this is not school work or anything else, just messing around and modifying a friends program. I have a keypad that we created, what I would like to do is for a ACCESS DENIED I want a certain sound played, and on a Access Granted, I would like a different sound played. Is there a way to do this. here is what I have.

VB Code:
Option ExplicitDim mAccessCode As Long Private Sub cmdButton0_Click()    txtDisplay.Text = txtDisplay.Text & "0"End Sub Private Sub cmdButton1_Click()    txtDisplay.Text = txtDisplay.Text & "1"End Sub Private Sub cmdButton2_Click()    txtDisplay.Text = txtDisplay.Text & "2"End Sub Private Sub cmdButton3_Click()    txtDisplay.Text = txtDisplay.Text & "3"End Sub Private Sub cmdButton4_Click()    txtDisplay.Text = txtDisplay.Text & "4"End Sub Private Sub cmdButton5_Click()    txtDisplay.Text = txtDisplay.Text & "5"End Sub Private Sub cmdButton6_Click()    txtDisplay.Text = txtDisplay.Text & "6"End Sub Private Sub cmdButton7_Click()    txtDisplay.Text = txtDisplay.Text & "7"End Sub Private Sub cmdButton8_Click()    txtDisplay.Text = txtDisplay.Text & "8"End Sub Private Sub cmdButton9_Click()    txtDisplay.Text = txtDisplay.Text & "9"End Sub Private Sub cmdButtonClear_Click()txtDisplay.Text = ""End Sub Private Sub cmdButtonEnter_Click()    Dim message As String        mAccessCode = txtDisplay.Text    txtDisplay.Text = ""        Select Case mAccessCode        Case Is < 1000            message = "Access Denied"            Beep        Case 1645 To 1689            message = "Technician Personnel"        Case 8345            message = "Custodial Services"        Case 55875            message = "Special Sevices"        Case 999898, 1000006 To 1000008            message = "Scientific Personel"        Case Else            message = "Access Denied"    End Select    lstLogEntry.AddItem Now & Space$(3) & message    End Sub


Help With Creating A Virtual Keypad
Hello! Im trying to create a virtual keypad on a form. I want it so the user clicks on the buttons corresponding to the letters and then this is displayed in a text box.

My buttons are within a control array and I can display single letters in the textbox but I cant figure out how to join the letters together in my textbox. I want it so the user can type out a word within the textbox.

Am I going to have too create a recordset and store each letter then reproduce the string within the textbox? It seems a bit long winded.

Thanks for any help.


Keypad Array Coding
I am working on a project for school called snack bar, with entree's, sides, condiments, topping, drinks, cash, credit(for faculty)and no sale. but I am having a problem with coding the "Number Keypad" which I call Nkeys. I haven't worked with the keypad coding that much, but right now I could you some help. Have been sick with the stomach virus and have to get this turned in soon. but would like to turn it in with some more bugs worked out. This is what I have so far on the coding of the keypad, but I can't seem to get it to enter in any amount for entree's, sides and drinks, plus the type of sales when entering numbers. Any help would be greatly appriecated. due to I am still learning and know I have a long way to go. thanks a head of time
Option Explicit
'LaVonda Pearson
'setting up form level variable to be used
Private sngCash As Single, sngGTot As Single, sngChange As Single
Private sngTax As Single, sngTot As Single
Private strNkey As String, strEntree As String, strSides As String, strCond As String
Private sngEPrice As Single, sngSPrice As Single, sngCPrice As Single, sngDPrice As Single
Private strDrinks As String, strdressing As String

Private Sub chkDressings_Click(Index As Integer)
Select Case Index 'as dressing or sauce is chosen it is inputted to the listbox
Case 0
strdressing = "R"
Case 1
strdressing = "1000"
Case 2
strdressing = "HM"
Case 3
strdressing = "F"
Case 4
strdressing = "O/V"
Case 5
strdressing = "BBQ"
Case 6
strdressing = "NONE"
End Select
If cmdSType(2).Value = True Then
End If
lstOView.AddItem strdressing

End Sub

Private Sub cmdDrinks_Click(Index As Integer)
Select Case Index 'enter drink choice to listbox
Case 0
strDrinks = "Soda @ .75"

Case 1
strDrinks = "Tea @ .75"

Case 2
strDrinks = "Water @ .50"

Case 3
strDrinks = "Coffee @ .75"

End Select
lstOView.AddItem " " & cmdDrinks(Index).Caption
Print #1, strNkey & " " & strDrinks
sngTot = sngTot + sngDPrice
lblTot.Caption = Format(sngTot, "currency")

End Sub

Private Sub cmdEntrees_Click(Index As Integer)
Select Case Index 'as entree is chosen it is inputted to the listbox
Case 0
strEntree = "HB @ .99"
sngEPrice = 0.99
Case 1
strEntree = "CHB @ 1.99"
sngEPrice = 1.99
Case 2
strEntree = "CHK SNDW @ 1.99"
sngEPrice = 1.99
Case 3
strEntree = "CHK Strips @ 2.25"
sngEPrice = 2.25
Case 4
strEntree = "Side Salad @ 1.50"
sngEPrice = 1.5
Case 5
strEntree = "Chef Salad @ 2.99"
sngEPrice = 2.99
End Select
If cmdSType(2).Value = True Then
End If

lstOView.AddItem strNkey & " " & strEntree
Print #1, strNkey & " " & strEntree
sngTot = sngTot + sngEPrice
lblTot.Caption = Format(sngTot, "currency")

End Sub

Private Sub cmdNkeys_Click(Index As Integer)
'get keypad working
Dim x As Integer

strNkey = ""

strNkey = strNkey & cmdNkeys(x).Caption

End Sub

Private Sub cmdSides_Click(Index As Integer)
Select Case Index 'as side is chosen it is inputted to the listbox
Case 0
strSides = "FF @ .99"
sngSPrice = 0.99
Case 1
strSides = "CHFF @ 1.50"
sngSPrice = 1.5
Case 2
strSides = "Chili @ 1.50"
sngSPrice = 1.5
End Select
lstOView.AddItem " " & cmdSides
Print #1, strNkey & " " & strSides
sngTot = sngTot + sngSPrice
lblTot.Caption = Format(sngTot, "currency")

End Sub

Private Sub cmdSType_Click(Index As Integer)
'Setting up for payment type and responses.

Dim strID As String, strMsg As String
Dim x As Integer, y As Integer
sngTax = sngTot * 0.065
sngGTot = sngTot + sngTax
lblTot.Caption = sngGTot
Select Case Index
Case 0 'cash
lblTot.Caption = Format(sngGTot, "currency")
sngCash = Val(InputBox("Please Enter cash amount", "Cash Tendered"))
If sngCash &lt; sngTot Then
strMsg = Val(MsgBox("You have not entered enough money!", vbRetryCancel + vbInformation + vbDefaultButton1 + vbApplicationModal))
sngCash = MsgBox("Please enter cash amount", "Cash Tendered")
End If
sngChange = sngCash - sngTot
lstOView.AddItem Space(50) & "order Total: " & Format(sngGTot, "currency")
lstOView.AddItem Space(50) & "Collected: " & Space(5) & Format(sngCash, "standard")
lstOView.AddItem Space(50) & "Tax: " & Space(13) & Format(sngTax, "fixed")
lstOView.AddItem Space(50) & "Change: " & Space(7) & Format(sngChange, "fixed")
Print #1, "Cash" & Format(sngTot, "currency")

Case 1 'credit
lblTot.Caption = Format(sngGTot, "currency")
strID = InputBox("Please enter Employee ID#", "Employee ID")
lstOView.AddItem Space(50) & "Order Total: " & Format(sngGTot, "currency")
lstOView.AddItem Space(50) & "Charge to ID#: " & strID
Print #1, "Charge to ID#: " & strID

Case 2
Print #1, "NO SALE"
End Select
If cmdSType(2).Value = True Then
End If
For x = 0 To 8
optCond(x).Value = 0
Next x
For y = 0 To 6
chkDressings(y).Value = False
Next y
lblTot.Caption = Format(sngTot, "currency")
lblTot.Caption = " "
sngTot = 0
lstOView.AddItem "___________________________________________________________________"
Print #1, "_______________________________________________"
lstOView.AddItem Date & Time
Close #1
Open App.Path & "active.txt" For Append As #1
Write #1, lstOView.Text

End Sub

Private Sub Form_Load()
'setting up form sizing
frmSnackBar.Top = (Screen.Height - frmSnackBar.Height) 2
frmSnackBar.Left = (Screen.Width - frmSnackBar.Width) 2

Open App.Path & "active.txt" For Append As #1 'writting to file as sales are
Write #1, lstOView.Text 'preparing the squech.file for documentation
lstOView.AddItem Date & Space(53) & Time
Print #1, Date & Space(10) & Time
Dim strID As String 'getting the employees name/ID# and password
Dim strPassword As String, strMessage As String
strID = InputBox("Please enter your name or ID#", "Name or ID#!")
If strID = " " Then
MsgBox "You must enter either Name or ID#"
strID = InputBox("Please enter your name or ID#", "Name or ID#!")
End If
strPassword = InputBox("Please enter you password!", "Employee Password")
If strPassword &lt;&gt; "phil" Then
MsgBox "Invalid Passowrd", vbOKOnly
strPassword = InputBox("Please enter you password!", "Employee Password")
End If
Print #1, "Employee ID: " & strID

End Sub
Public Sub NOSALE()

End Sub

Private Sub lstOView_Click()

End Sub

Private Sub optCond_Click(Index As Integer)
Select Case Index 'adding toppings as selected
Case 0
strCond = "Ket"
Case 1
strCond = "Must"
Case 2
strCond = "Mayo"
Case 3
strCond = "Ch @ .25"
sngCPrice = 0.25
Case 4
strCond = "Onions"
Case 5
strCond = "Chili"
Case 6
strCond = "Let"
Case 7
strCond = "Tom"
Case 8
strCond = "SL"
Case 9
strCond = "Everything"
Case 10
strCond = "Nothing"
End Select
Dim x As Integer
Dim listcontent As String
' For X = 1 To 8 'trying to delete off if customer changes mind
' listcontent = optCond.Item(0)
'If X &gt; 1 Then
' optCond.RemoveItem (0)
' End If
' Next X
If Index = 3 Then
lstOView.AddItem strCond
lstOView.AddItem optCond(Index).Caption
End If

Print #1, strNkey & " " & strCond
sngTot = sngTot + sngCPrice
lblTot.Caption = Format(sngTot, "currency")

End Sub
it's a long one but this is everything I have done so far.

Enable Numeric Keypad Input do I enable a user to enter numbers with the numeric keypad? This is what I've tried...

Select Case KeyCode

Case 0x60 to 0x69

End Select

Imitating A Mobile Phone Keypad.
Being very new to VB im having a few problems.
What I need to be able to do is as follows:
Mimic the way a mobile phone key works, such as the 2 key for example. I need to display a 2 when the 2 key is pressed once, an A if pressed twice, a B for three pressed and a C for the fourth.

Cheers for you're time.
Thanks for any help in advance :-).

My Send Keys And Mobile Keypad
hi i am trying to send keys to a mobile emulator (mobile screen ) from a text box...** my opearating system is vista and i am using sendinput function**..i can send letters and symbols but when i try to send a numerical value for example 4 the result is 'g' ...but when i send 4444 then i get the outcome as 4 ...briefly explaning ** while sending sms from one's cell phone to get the number 4 we have to press the button 4 four times..**.thats my problem..i want the user to get the number 4 and not g if the user has input 4 in the text box

How To Enable The Numeric Keypad In Keyboard?
this code is originally posted by Mathew Gates i think :

VB Code:
Private Declare Function BlockInput Lib "user32" (ByVal fBlock As Long) As Long  'to block the Mouse and KeyboardBlockInput True 'to release the Mouse and KeyboardBlockInput False

it's working ok, but the problem is... i want to enable some part of the keyboard let say the Numeric Keypad in order for my user to type a combination of numbers that will serve as his password, and if the password is right he can unload the program.

so, when i locked the mouse and keyboard, i load a form that has one textbox having the focus so the user can enter the secret key... how can i do that?


Numeric KeyPad - User Control Problem
Hi everybody

I am working on a simple component which is used to be a numeric keypad
i mean just only numeric values could be entered with this component
it is a only label with a little difference there would be a numeric keypad below when clicked
(look picture attached) it is my work which i planned, but couldn't succeed

in my user control i formed a label which looks like a textbox and a keypad that used to enter numeric values
for the present, this keypad is in user control

as you can understand when clicked control, this keypad would appear below control
but i have not enough knowledge about making this arrangement

when i positioned the keypad it is not seen below, because it is in user control therefore i couldn't get it out

any one have idea about doing that

On Screen Numeric Keypad, Output Variable To Another App
I am attempting to create a onscreen numeric keypad. How can I make the value of a varible "output" to another app.

For example, load up google, type in some numbers on the keypad via the buttons, then hit a enter button and have the numbers put into the search box of google.


Numeric Keypad On Form Within Access 2003
I'm trying to create a numeric keypad that users would use with a touchscreen. The keypad would have 0-9 and when a number was pressed it would enter the value into a text field. Once the submit button is depressed it updates a table with the values the user selected. I have been able to create a numeric keypad that allows the data to be entered but once it is submitted, the next time you try to enter data it automatically populates with the data from the last entry. Any ideas on how to get this form to reset so that it takes new values?

Numeric Keypad Input As Mouse Commands

I'm facing the following problem.
Playing with the mouse setting, I sent a SPI_SETMOUSEKEYS (using the SystemParametersInfo) message to the system with the following mouse settings.


.cbSize = Len(pMOUSEKEYS)
.dwReserved1 = 0
.dwReserved2 = 0
.iCtrlSpeed = 10
.iMaxSpeed = 200
.iTimeToMaxSpeed = 1000
End With

Everything worked fine. I donít know why, but the system is now processing my numeric keypad input as mouse commands.

It seems that I set the MKF_MOUSEMODE flag, despite the fact that I didnít do it.
Does anyone know how to tell the system to no more process the numeric keypad input as mouse commands?

Thanks in advance for your help

2008: Problems Setting Focus On A Textbox With Integrated Numeric Keypad
I am making a program that will allow restaurant managers to configure terminals. The terminals do not have keyboards, and they are all touch-driven. Therefore, I created a simple 10-key numberpad that the user can use to configure the terminal. I thought of utilizing the on-screen keyboard provided with XP, but after testing the keys are too small and there are no options to make them larger.

The problem that I am having is I cannot get the focus on the textbox that I want. I tried to solve this issue by installing a radio button system at the upper right hand corner of the window. However, this is just one more step for the end-user and I do not want to confuse them. Does anybody have any other suggestions of a good way to do this?

I was using SendKeys, but then I have read a lot of information about the negativity surrounding it. I think it may work well for this program, since it will be nearly full-screen on the terminal (800x600).

Please feel free to ask any questions you may have. I appreciate any assistance.

Pics attached.

Copyright © 2005-08, All rights reserved