|
-
Apr 7th, 2006, 06:22 PM
#1
Thread Starter
New Member
KeyDown event in a usercontrol (OCX)
Well, my problem i think it's a bug. Firts the keydown event raises twice when i press "delete" key. But now, when i press that key, the keydown event does not raise. i create a ocx with some control placed on it, i place this ocx in a html page and the keydown event does not work, but if a put the ocx in a form in a standard vb form, the event works fine. i mean, the keydown event into the usercontrol does not work, i didn`t use raisevent method to expose the keydown event with the ocx.
I hope somebody understand this issue and have a tip for me, i'll realy appreciate that.
Thanks, Diego
-
Apr 8th, 2006, 11:00 PM
#2
Re: KeyDown event in a usercontrol (OCX)
 Originally Posted by reyesdiego
i didn`t use raisevent method to expose the keydown event with the ocx.
Why do you expect it to raise an event if you're telling it not to?
-
Apr 10th, 2006, 07:46 AM
#3
Thread Starter
New Member
Re: KeyDown event in a usercontrol (OCX)
Thank you AL42. Sorry, Perhaps my english is not good. What i'm trying to say is: I want to use the usercontrol_keydown event internally in the OCX, i don't need to expose that event out of the OCX. For example, someone press the "Delete" key, internally i have to do something with usercontrol_keydown event, but the html page where the OCX is placed does not need to know about that, so i did not expose the usercontrol_keydown with the raiseevent method. Well, the problem is that the keydown event of the usercontrol is not triggered.
-
Apr 10th, 2006, 10:00 AM
#4
Re: KeyDown event in a usercontrol (OCX)
usercontrol_keydown would be the form's keydown. Do you have the usercontrol's form KeyPreview set to true? If not you have to trap the individual control keydown events, not the usercontrol's keydown.
-
Apr 10th, 2006, 11:56 AM
#5
Thread Starter
New Member
Re: KeyDown event in a usercontrol (OCX)
 Originally Posted by Al42
usercontrol_keydown would be the form's keydown.
I have to do something in the usercontrol_keydown, it's a OCX and i have to do some code in the ocx against to repeat the code in every form i place the ocx. And i dont place the ocx on a form, i place it in a html page.
KeyPreview set to true is made.
To tell you more !!.. if i run the ocx project alone with the "Wait for componets to be created" in the debugging project properties, and i naveigate the page where the ocx is placed, the usercontrol_keydown event is triggered fine.
-
Apr 10th, 2006, 01:21 PM
#6
Re: KeyDown event in a usercontrol (OCX)
Do you want the usercontrol_keydown event to fire even if the user presses a key when something else on the page has the focus? Or only if he presses a key in your user control's form?
-
Apr 11th, 2006, 09:31 AM
#7
Thread Starter
New Member
Re: KeyDown event in a usercontrol (OCX)
I put the ocx on an .asp page. If i use that page with a open window, i mean :
var oWin = window.open("mypage.asp"),, the ocx placed on that page does not trigger. If i use : var oWin = window.showModalDialog("mypage.asp"), the usercontrol_keydown event triggers FINE... Don`t ask why at the moment, it drives me crazy !!!
Thank You Al, i wanted to let you know about the conclusion of this problem
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
|