|
-
September 30th, 2005, 04:41 AM
#1
Handle textbox's event by the form
Hi,
I have a problem with event handling.
I have a Form and one textbox drawn on the form. I want to handle the keypress event of textbox as follows:
whenever I press normal keys like a-z or 0-9 then event occurred on textbox, if I press other than these keys event should be passed to the form.
I hope Ihave explained my problem.
If any soln. plz help me.
Thanks in advance.
-
September 30th, 2005, 04:49 AM
#2
Re: Handle textbox's event by the form
textbox_keypress....
if (keyascii is within your range) then
.........
else
form_keypress (or which ever event you want to run)
end if
If you find my answers helpful, dont forget to rate me 
-
October 1st, 2005, 03:49 AM
#3
Re: Handle textbox's event by the form
Hi,
Above code may work properly but on every text box i will have to write this code.
Actually my need is diffrent.
I want to make our own shorcut keys like Alt+A. If focus is on text box then every event occured on text box. I want to capture all the keys event other than A-Z n 0-9. if user press any key, other than these key. then Form's event should be occured.
thats it.
-
October 1st, 2005, 07:46 AM
#4
Re: Handle textbox's event by the form
Set the KeyPreview property of the form to True and create an event handler for both the form and the TextBox. Then you just test for the specific keys that you want each to handle. Note that the form will receive the event first.
-
October 5th, 2005, 03:44 AM
#5
Re: Handle textbox's event by the form
I will see it. if success then thanks.
-
October 5th, 2005, 04:00 AM
#6
Re: Handle textbox's event by the form
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|