Detecting CTRL+Click in Webbrowser Control - vb.net

Ok! Here is the situation I have a application using Webbrowser Control, I want to detect the click events for anchors in web page. I dont need code, just the directions to look into.
Edit
I didn't find any solution for the problem but found a hack in Control.ModifierKeys, this works until now!

[WebBrowserNavigatingEventArgs][1]
http://msdn.microsoft.com/en-US/library/system.windows.forms.webbrowser.objectforscripting.aspx

Related

VB.NET Putting the menu into controlbar like Firefox

The new Firefox versions do not have the regular menus anymore.
Instead the menu can be reached by clicking the orange button which is somehow integrated into the form's controlbar. This saves some space on the client area.
I would like to do the same with VB.NET and WinForms.
Could anybody please tell me
a) what this is called? I did not find any information on this on Google, perhaps because I just didn't find the right term.
b) Perhaps a starting point on how to do this?
Thank you very much.

Selenium IDE: How to check if an element has a focus?

Is there a built in method for checking that an input text element has a focus ?
Well, I didn't find one, so I tried this extension.
But, it doesn't work for me either (i.e. the test fails).
Any ideas ?
I have had numerous problems detecting if an element has focus because the browser Selenium is controlling typically does not have the focus within the Operating System, and as such the browser will NOT consider any elements to have focus until the browser regains the focus.
I have been pulling my hair out over this, so worked up a solution to this problem. See http://blog.mattheworiordan.com/post/9308775285/testing-focus-with-jquery-and-selenium-or
for a full explanation of the problem and a solution to this.
If you can't be arsed to read the lengthy explanation, simply include https://gist.github.com/1166821 BEFORE you include JQuery, and use $(':focus') to find the element that has focus, or .is(':focus') to check if an element has focus.
I wrote that plugin and it is working fine in my environment.
Could you provide me a detailed description of how you used it? I would try bugfix it if we will find a bug.

Windows Phone 7 WebBrowser control swallows manipulation events?

If I place a WebBrowser control on any page, the page no longer responds to manipulation events under the WebBrowser. Other areas of the page work fine.
It's easily confirmed by overriding OnManipulationCompleted in a page, then placing a WebBrowser control on the page. Try swiping over the WebBrowser, and OnManipulationCompleted is never called.
I can't set the WebBrowser to IsHitTestVisible=false because I need to be able to click on links. But I want the page to respond to left/right swipes.
Anyone got any bright ideas? Or know if this is a bug in the current release?
I'd like to extend what Skeet already written.
The point is, that the MS WP7 dev team has published "guidelines", where they highly discourage putting (on the same page) multiple layout controls that accept and react to the same set of gestures. For example, you shouldn't try to embed a Pivot inside a Pano, because the horizontal-swipe will clash and it will be hard do distinguish which of them should execute its actions. The same case is with the browser: it responds to all swipes and pans.. so should not be put in almost any scrolling control!!
Now, having said that, I want to tell you it is possible to overcame it - although it may turn not easy, depending on your actual case.
The most trivial thing to do, if you want to still be notified about the gestures is to use GestureService/GestureListener from the Silverlight Toolkit library. Even when the WebBrowser extinguishes the raw manipulations events, the GestureListener will still be able to notify you - because it apparently listens on some "other layer", I don't exactly want to get in to it now. Just fetch the library, add-reference it, do something like:
GestureService.GetListener( targetcontrol ).Flick( myBrowserFlickHandler );
and it's done - you get the notification whenever someone flicks on the control, with completely no regard of the manipulation events being e.handled=true or not. Small disclaimer here: I don't remember if on 7.0 it works, because the WebBrowser is build a bit differenlty there. On 7.1 and 7.5 it should work.
However, if you apply that on a WebBrowser - you will get the notif - but the webbrowser will get it too. That means, that 2 controls will react, and it turn to be visually quite rejecting if you start some storyboards from within the handler..
On 7.1 and almost-current 7.5, it is possible to play hard with the WebBrowser and to completely control which manipulation-event it will see. Thus, by filtering the mani-events for the WB, and by using GestureListener to see the events yourself, you can both block the WB from doing anything, and at the same time you can respond with your own action instead. I've written about that extensively in a response to similar problem, see WP7 Pivot control and a WebBrowser control for details. It is not a quick/easy/funny thing to do though.
EDIT: and MOST importantly, it is NOT guaranteed to work in the future. Throughout the 7.1 and 7.5 SDK/OS/API versions, inside the WebBrowser control some major internal undergoing changes are visible, and I would not be surprised, if it would dramatically change in the next few releases. Don't play with the things I've wrote there about if you do not want to have to revisit the subject again in the next 1-2 years.
This is a consequence of the way we implemented WebBrowser. The touch events are handed off directly to the browser engine. Once that happens Silverlight is basically out of the picture. Unfortunately I can't think of any workarounds that might give you what you want. -Skeets, MS dev
If you really want it:
<Grid>
<phone:WebBrowser Source="http://www.microsoft.com" />
<Rectangle Fill="Transparent" ManipulationCompleted="HandleManipulationCompleted"/>
</Grid>
But of course it completely locks down interaction with web browser control and there's just no way to echo manipulation events to browser...
I think you have a better way capturing the manipulation events, if it is in WP7.5 Mango since the browser controls are completely different, which I read from this link

Cut and paste out of/ into text fields in a separate window doesn't work

I have a Macintosh Mozilla plugin which puts up a separate window for login information.
It seems to work fine, it gets keyboard events like typing and hitting
return to hit the default button. HOWEVER, it doesn't seem to get cut
and paste events. When I hit Cmd-v, the edit menu flashes, but nothing
happnes.
Is this a problem with my responder chain? Do I have to specially tell
Mozilla that I want these events? or am I likely to have some other
problem that I haven't even thought of?
It turns out the problem is that I'm using cocoa windows inside Mozilla, which isn't Cocoa... fail.

Testing checkbox click

I have started testing my UI using qUnit, so I need to simulate some user interaction. Is it possible to "simulate" a user clicking a checkbox using javascript ?
Thx guyes. I figured it out about two seconds after I posted the question. It was as you say simpler than I had imagined
document.getElementById('cb1').click();
did the trick
Edit: It seems in IE7 (and perhaps other browsers) the the click method will not actually check the checkbox. So to fully simulate you need to "check" the checkbox before clicking it
document.getElementById('cb1').checked=true
document.getElementById('cb1').click();
You can look at this:
Simulate a buttonclick via javascript
It is the other way arround, so i'm not sure if it works on checkboxes too.