Need tab and Return key for IE Hosted UserControl

  • Thread starter Thread starter Frank Lee
  • Start date Start date
F

Frank Lee

I am writting an IE Hosted UserControl, which has a TextBox for accept
input. In the textbox, I use OnKeyDown handler to check the user pressed
key. Which work fine under WinForm environment.

However, under IE with form environment, the Key tab and return are took by
IE.
How can I get the Key tab and return in textbox under IE environment?

Thanks.

---Frank
 
Hi

You got to use SetWindowsHookEx

Like:

SetWindowsHookEx(IDHook,MsgHookProcedure,(IntPtr)0,AppDomain.GetCurrentThreadId())

Good Luck

Regards,

Daniel Roth
MCSD.NET
 
Only SetWindowsHookEx?

Are you sure SetWindowsHookEx can work under WinForm + IE Hosted?
or you just ask me to run ActiveX and abort IE Hosted?

Thanks.
 
Good news, I got Return Key for set textbox.AcceptsReturn=True.

Unforturnately, textbox.AcceptsTab=True doesn't work for IE hosted
environment.
 
Hi

Look for a "How to" post I did on .NET ,ActiveX and IE then when you
got that do some win32 using SetWindowsHookEx and a MsgHook Procedure.

It's not the easiest but it gives you the most control.

Regards,

Daniel Roth
MCSD.NET
 
I don't think using platform invoke inside IE hosted controls is a good
idea.
While it is still possible but has some deployment difficulties.
 
I don't think using platform invoke inside IE hosted controls is a good
idea.
While it is still possible but has some deployment difficulties.

Yes, I agree you.

However, if design IE Hosted controls for enterprise application use, but
not for global web use, it is enough. And for enterprise application use,
deployment problem is not so important.

You have another idea to do function-like controls?
ActiveX?

In my mind, I think they are the same. And sometimes, deploy IE Hosted
controls is easier than ActiveX for me because IE hosted controls doesn't
need to have a certification from 3rd public association if only for
enterprise application use.

If you have another idea, I would like to know.
Thanks

---Frank
 
SetWindowHookEx( ) is a good choice for ActiveX since when it is installed
you already have required permissions to call that API function.
But in IE Hosted controls things have changed and we could have an IE Hosted
control installed with no difficulty but with limited access - no
PlatformInvoke by default. We may go on by modifying .NET Framework's
default security policy which I do not prefer but is sometimes a solution.
 
Back
Top