|
-
Jun 30th, 2001, 09:47 PM
#1
Thread Starter
Member
Webbrowser Control - Preventing use of Alt-Left Arrow Key or Right mouse click
How would one use the webbrowser Control but capture the user right mouse click or alt-left arrow (hot key to go back to previous webpage) before the Control recieves it?
I've tried capturing the keystrokes at Form level:
Code:
Private Form_KeyDown(KeyCode As Integer, Shift As Integer)
If (KeyCode = 37) And (Shift = 4) Then
Label1.Caption = "message caught"
End If
End Sub
... but that doesn't work.
I've tried making a new usercontrol with the webbrowser embedded into it with the code above implemented at UserControl level.. no luck again...
Any suggestions/solutions?
-
Jul 1st, 2001, 12:49 AM
#2
Hyperactive Member
For ALt+Left, try Before_Navigate2 event which has a Cancel capability. I have not tried it. I'm tired. If your users do not need to be able to highlight and copy then you might try setting .Visible = false in GotFocus and .Vsible = true in LostFocus. Dumb, but still food for thought.
-
Jul 1st, 2001, 08:08 AM
#3
Thread Starter
Member
Thanks for the reply. Actually, I think the problem maybe even more general than what I specified...
I now need to prevent certain keystrokes all together from reaching the webbrowser control... (ALT-Left, Ctrl-N (new window), CTRL+A (select All), F5 (refresh)).
Is there a way to trap the keystrokes instead?
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
|