Print Page | Close Window

Only numbers

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Command Bars
Forum Description: Topics Related to Codejock Command Bars
URL: http://forum.codejock.com/forum_posts.asp?TID=11159
Printed Date: 07 October 2024 at 6:17pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Only numbers
Posted By: luisinho
Subject: Only numbers
Date 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



Replies:
Posted By: luisinho
Date 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)


Posted By: Bernie
Date 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


Posted By: luisinho
Date 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.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net