Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Please help. 2

Status
Not open for further replies.
Nov 5, 2004
27
PH
Hello there,
I would like to ask if there are functions similar to isalpha() or alnum() of C++ in Visual Basic 6? If there are, please give me some examples of codes.Thanks.
 
The closest is isNumeric(), which only checks for numbers. You can write your own without a problem, though.

Lee
 
If you need more flexibility, try loading the data value into a Variant-type variable & running it through the VarType() function. It'll return an integer value indicating the evaluated sub-type: 1 for null, 2 for integer, 8 for a string, etc.
 
Thanks a lot!!!I can used that command now to filter the data that can be entered by a user in a textbox.The data will only be entered if it is a number.Well i have another problem.I want my program that whenever the user presses the key ALT+F4 the form will end.I have used vbkeyf4 in the form_keydown event.But the problem there is that i want it to integrate with the ALT key.How will i combine these keycodes to form the ALT+F4 task and on what event procedure must it be place that usually closes a window?Thanks.

 
The KeyDown event has 2 arguments:

Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)

From VBHelp:
The Shift value is an integer that corresponds to the state of the SHIFT, CTRL, and ALT keys at the time of the event. The shift argument is a bit field with the least-significant bits corresponding to the SHIFT key (bit 0), the CTRL key (bit 1), and the ALT key (bit 2 ). These bits correspond to the values 1, 2, and 4, respectively. Some, all, or none of the bits can be set, indicating that some, all, or none of the keys are pressed. For example, if both CTRL and ALT are pressed, the value of shift is 6.

To close a form called myForm:

Unload myForm

________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first

'If we're supposed to work in Hex, why have we only got A fingers?'

for steam enthusiasts
 
You don't need to do anything to get Alt-F4 working. It is a built-in Windows shortcut for closing a window
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top