can not active Contacts.PreviewContactDownEvent

Aug 3, 2009 at 4:11 AM


WebBrowser web = new WebBrowser();
web.AddHandler(Contacts.PreviewContactDownEvent, new ContactEventHandler(WebBrowser_PreviewContactDown));
web.Navigate(new Uri(""));

when i touch the browser, can not active the WebBrowser_PreviewContactDown.  why?

Aug 3, 2009 at 4:45 AM

This forum isn't for general Surface help, but I can answer your question anyway.

The WebBrowser control is a wrapper for a Win32 control, and Win32 does not respond to or interact with Surface contacts.  This is also why the WebBrowser control cannot be rotated or transformed.  There are some ways to get around this but in general browsing the web on the Surface is not an ideal experience or recommended task. 

If you have access to you can search for WebBrowser to see some options.

Aug 3, 2009 at 4:59 AM

can not sign into

error: Sorry! It appears you either don’t have an invitation or your invitation has already been used. If you feel this is an error, please contact us or your company sponsor.

Aug 3, 2009 at 5:01 AM

You'll have to talk to your company or organization that you're developing Surface for to see if they can get you an invite.

Aug 3, 2009 at 5:08 AM

Thanks joshb!

can i do that like the SurfaceVEMap control

Aug 3, 2009 at 5:11 AM

The core Virtual Earth control is also Win32 based, but I made it work fully with WPF and Surface by doing some tricks and interacting with the control in some specific ways.  That won't apply to the WebBrowser control.

Aug 3, 2009 at 5:16 AM

i just for active Contacts.PreviewContactDownEvent when touch the webbrowser control range

Aug 3, 2009 at 5:24 AM

I don't have any code samples or further information on the WebBrowser, but the basic idea is you have to make a transparent window on top that catches the events then manually forward those to the WebBrowser control.  This approach causes a lot of other problems though too that you'll have to work through. 


Aug 3, 2009 at 6:09 AM

i had try by the SurfaceVEMap control way , but fail.

the code :

could you help me?


Aug 3, 2009 at 12:34 PM

I took a quick glance and see you tried to use some code from SurfaceVEMap.  The WebBrowser control will not work the same way because it is not rendered using Direct3D.  The SurfaceVEMap approach won't work for you.  You need to get access to to see other code samples.

Sorry I can't be of more help.

Aug 3, 2009 at 12:53 PM

hi joshb

you are right.

so i try to make a transparent surface control on top the webbrowser,but not any surface control can top the webbrowser.

no way to do that????