Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7633829
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T06:59:42+00:00 2026-05-31T06:59:42+00:00

I am developing an Windows Forms application using VB.NET that offers the user to

  • 0

I am developing an Windows Forms application using VB.NET that offers the user to lookup addresses on Google Maps through a Web Browser. I can also successfully show the directions between two points to the user, as well as allow the user to drag the route as he/she pleases. My question now is – is it possible for me to get the lattitude/longitude information of the route, i.e. the overview_polyline array of encoded lattitude/longitude points and save it to e.g. a text file on my computer? Or is it possible to get a list of all the addresses located both sides of the route over the entire length of the route, and then save the data to a file on my computer? I’m using HTML files to access and display the Google Maps data in the Web Browser item.

Thank you

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T06:59:44+00:00Added an answer on May 31, 2026 at 6:59 am

    This is actually pretty simple if your just looking for the screen coordinates.

    // this probably should be in your form initialization 
    this.MouseClick += new MouseEventHandler(MouseClickEvent); 
    
    
        void MouseClickEvent(object sender, MouseEventArgs e) 
        { 
            // do whatever you need with e.Location 
        } 
    

    if your strictly looking for the point in the browser, you need to consider the functions

    browser.PointToClient(); 
    browser.PointToScreen(); 
    

    So, this method is usable if you know exactly where your form is (easy to get its coords) and where you webbrowser control is (easy to get coords of this as well since it’s just a control in your form) and then, as long as you know how many pixels from the left or right, and from the top or bottom the image will be displayed, once you get the global mouse click coords (which is easy) you can predict where it was clicked on the image.

    Alternatively, there are some scarier or uglier ways to do it here…

    You can use the ObjectForScripting property to embed code to do this in the webbrowser. It’s ugly to say the least. MSDN has some documentation on the process here: http://msdn.microsoft.com/en-us/library/system.windows.forms.webbrowser.objectforscripting.aspx

    Because its really ugly, maybe a better solution is to use AxWebBrowser – it’s ugly too but not so scary.

    In addition, I found this post of someone wanting to do it on a pdf document, and a MSFT person saying its not possible, but really what he is trying to say is that it isn’t built in, even with a pdf document its still possible to predict with high to certain accuracy where it was clicked if you use the first method i described. Here is the post anyway: http://social.msdn.microsoft.com/Forums/en/csharpgeneral/thread/2c41b74a-d140-4533-9009-9fcb382dcb60

    However, it is possible, and there are a few ways to do it, so don’t get scared from that last link I gave ya.

    Also, this post may help if you want to do it in javascript:
    http://www.devx.com/tips/Tip/29285

    Basically, you can add an attribute on the image through methods available in the webbrowser control, you can add something like onclick=”GetCoords();” so when it is clicked, the JavaScript function will get the coords, and then you can use javascript to place the values in a hidden input field (input type=”hidden”) which you can add through the webbrowser control, or if there is one already on the page, you can use that. So, once you place the coords using javacript into that input field, you can easily grab the value in that using the webbrowser control, eg:

    webbrowser1.document.getElementById("myHiddenInputField").value
    

    That will get the value in that field, which you’ve set through JavaScript. Also, the “GetCoords()” function i mentioned is called SetValues() in the javascript method link i provided above (in the devx.com site) but I named it GetCoords because it makes more sense and didn’t want to confuse you with the actual name they used, you can change this to any name you want of course. Here is the javascript they were using, this only gets the coords into a variable, doesn’t put it into a hidden input field, we will need to do that in addition (at the end of the javascript SetValues/GetCoords function).

    function SetValues()
    {
    var s = 'X=' + window.event.clientX + ' Y=' + window.event.clientY ;
    document.getElementById('divCoord').innerText = s;
    }
    

    These guys are just saving it inside a div element, which is visible to users, but you can make the div invisible if you want to use a div field, there is no advantage or disadvantage in doing that, you would just need to set the visible property to false using javascript or css, but still, it is easier to use a hidden input field so you don’t need to mess with any of that.

    Let me know how you get along.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm developing a web application that requires the user to log in using forms
I am developing a forms app (not web) for Windows Mobile, using .NET CF
Im developing a windows forms application using C# 4.0 and that application is going
I'm developing a windows forms application using VB.NET. I'm currently working on DataReport (by
We developing an Application using .NET Framework 4.0 (C#) windows forms based application. Now,
I'm developing a Windows Forms application using Visual Studio 2008 C# that uses an
I'm developing an Windows Forms application that requires me to call a separate program
I'm developing a web application and I need to mix Forms & Windows authentication
I'm developing C# .NET windows Forms application. In which I've a main window and
We are developing a .NET 3.5 application (Windows Forms), which is comprised of 3

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.