Only numbers |
Post Reply |
Author | |
luisinho
Newbie Joined: 23 June 2008 Location: Spain Status: Offline Points: 4 |
Post Options
Thanks(0)
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 |
|
luisinho
Newbie Joined: 23 June 2008 Location: Spain Status: Offline Points: 4 |
Post Options
Thanks(0)
|
'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) |
|
Bernie
Senior Member Joined: 05 July 2007 Location: Taiwan Status: Offline Points: 109 |
Post Options
Thanks(0)
|
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 |
|
luisinho
Newbie Joined: 23 June 2008 Location: Spain Status: Offline Points: 4 |
Post Options
Thanks(0)
|
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. |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |