hello all

i want to use shortcut keys ro call different functions in my window application... i have called functions on form_keypress and form_keydown... at the same time i m using a textbox and i want to limit user to enter only numeric data in the textbox but the problem is that if i use the form_key functions the textbox dnt take any input i m stuck in it i have coded a long way by defining another textbox and using that one to take the values entered by user in form_keyPress event but isn't there any easy and direct method to do that????? i hope you are getting my point clearly... please help me on that


Thanx
Regard

Abel Lazm

Recommended Answers

All 4 Replies

Before exiting the form_key functions, do you set the handled to true, false or do nothing?
Did you analize wich control has the focus to change the behaviour?

Back to work after a long break.... yes i set handled to true before exiting to the form_key function... i am not able to understand what is the problem

Welcome back. Hope you enjoy your break.
So the point is that you are pre-processing the input at form level so when in the textbox no key goes in.
The solution in this case is in the keydown/keypress events, set the handled to false if it is not a shortcut, so will be fordwarded to the next control.

Hope this helps

Thanks lolafuertes.... for welcoming me and answering my query :)... i have checked it and it is solved now thanks for helping :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.