Click here to Skip to main content
15,889,200 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Is there no way to draw a line in webBrowser control in C#?

WebBrowser is open on google earth.

Thanx for any help.
Posted
Updated 9-Jan-11 8:20am
v2
Comments
thatraja 9-Jan-11 5:35am    
Clear your question little bit please
Dalek Dave 9-Jan-11 14:20pm    
Edited fro GRammar and Clarity.

1. Render to to png with transparent background
2. Display png in <img /> and use that as an overlay (same position as map element, but higher zorder)

You can use System.Drawing.Graphics to create the png - possibly using a web handler.

If you are using the System.Windows.Forms.WebBrowser control you can interact with the IWebBrowser2 interface through the WebBrowserBase.ActiveXInstance. WebBrowser is derived from WebBrowserBase.

You should be able to use the handle of the System.Windows.Forms.WebBrowser to enumerate it's children, subclass and listen for mouse events. This is obviously is getting fairly convoluted, and you can hopefully get away with something simpler.

To give you anything more meaningful, I'll have to know more about what you are trying to achieve.

You can use this article as a starting point:
Thumbnailer HTTP Handler[^]

Regards
Espen Harlinn
 
Share this answer
 
v2
Comments
Mostafa Elsadany 9-Jan-11 6:37am    
im in windows application and drag on my form
webbrowswer tool
can you gave me more explain
thanx for your help
Mostafa Elsadany 9-Jan-11 6:38am    
there is no mouse move event in this tool
(webbrowser control )
Dalek Dave 9-Jan-11 14:21pm    
Good Answer.
Espen Harlinn 9-Jan-11 16:37pm    
Thanks Dalek!
As you said in comments to Espen's answer, there is no MouseMove event in the WebBrowser control.

It's easy enough to reimplement this hidden event by subclassing the control. I have no idea if this will enable you to solve your primary issue though!

C#
public class MyWebBrowser : WebBrowser
{
    public new event MouseEventHandler MouseMove;

    protected override void OnMouseMove(MouseEventArgs e)
    {
        MouseEventHandler eh = MouseMove;
        if (eh != null)
            eh(this, e);
    }
}
 
Share this answer
 
Comments
Dalek Dave 9-Jan-11 14:21pm    
Good Call.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900