Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Command Bars
  New Posts New Posts RSS Feed - Only numbers
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Only numbers

 Post Reply Post Reply
Author
Message
luisinho View Drop Down
Newbie
Newbie


Joined: 23 June 2008
Location: Spain
Status: Offline
Points: 4
Post Options Post Options   Thanks (0) Thanks(0)   Quote luisinho Quote  Post ReplyReply Direct Link To This Post Topic: Only numbers
    Posted: 23 June 2008 at 10:49am
I need a CommandBarEdit that it only let you to write numbers (no alphanumeric characters). I try to use the CommandBarKeyDown event to control that the keycode generates a numeric value but i dont know where are you writing (in what  CommandBarEdit, i have a lot)
I need something that i know in witch  control you ar writing.

I work VB6.0

(sorry about my english language)

Thanks
Back to Top
luisinho View Drop Down
Newbie
Newbie


Joined: 23 June 2008
Location: Spain
Status: Offline
Points: 4
Post Options Post Options   Thanks (0) Thanks(0)   Quote luisinho Quote  Post ReplyReply Direct Link To This Post Posted: 25 June 2008 at 11:33am
'I try this code, but it dont works

Private Sub pMenu_CommandBarKeyDown(CommandBar As XtremeCommandBars.ICommandBar, KeyCode As Long, Shift As Integer)
Dim Ctrl As CommandBarEdit
Select Case CommandBar.SelectedControl.Id
    Case ID_PRECIOS_ESTABLECER, ID_UNIDADES_ESTABLECER, ID_DTOCAB_PCG, ID_DTOCAB_VAL, ID_DTOCAB_PCG_AC, ID_DTOCAB_VAL_AC:
 
'this line works in a textbox but not works in the commandbar, i think
'i dont know witch control has the focus when the user are writing.
    If Not ((KeyCode > 47 And KeyCode < 58) Or Chr(KeyCode) = "," Or Chr(KeyCode) = "." Or KeyCode = 8 Or Chr(KeyCode) = "-") Then KeyCode = 0

'So, i need the user are only allowed to write numbers.

End Select
End Sub

'Xtreme Command Bars ActiveX v12.0.0 (VB6)
Back to Top
Bernie View Drop Down
Senior Member
Senior Member
Avatar

Joined: 05 July 2007
Location: Taiwan
Status: Offline
Points: 109
Post Options Post Options   Thanks (0) Thanks(0)   Quote Bernie Quote  Post ReplyReply Direct Link To This Post Posted: 01 July 2008 at 5:30am
Why doesn't CJ add a feature for CommandBarEdit Control like this?
CommandBarEdit.Flag = NumberOnly
CommandBarEdit.Flag = ReadOnly
 
 
Bernie Ho, Planning Manager + IELTS specialist + part-time programmer
Taiwan, R.O.C
Back to Top
luisinho View Drop Down
Newbie
Newbie


Joined: 23 June 2008
Location: Spain
Status: Offline
Points: 4
Post Options Post Options   Thanks (0) Thanks(0)   Quote luisinho Quote  Post ReplyReply Direct Link To This Post Posted: 01 July 2008 at 7:02am
I find this property in the commandbaredit control

Public Property EditStyle

it doesn't let me to show a mask only for numbers, dates, ...
, but you are allow to show a mask for a password.
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.203 seconds.