winforms - C# WebBrowser object not loading Uri -
i believe i've researched here , elsewhere enough justify posting new question. situation similar not identical others' reported problems.
as proof of concept building app hits google streetview , staticmaps api's , displays images of them in c# windows form (.net 3.5 time being). form has webbrowser object, 4 textboxes (street, city, state, zip) address input , "go" button.
here's code (and other reputable posts/sites, should need):
using system; using system.collections.generic; using system.componentmodel; using system.data; using system.drawing; using system.linq; using system.text; using system.windows.forms; namespace googlemapstest { public partial class form1 : form { public form1() { initializecomponent(); } private void button1_click(object sender, eventargs e) { webstreetview = new webbrowser(); uri urlstring = new uri("https://maps.googleapis.com/maps/api/streetview?size=300x300&location=" + txtstreet.text.replace(" ", "+") + "+" + txtcity.text.replace(" ", "+") + "+" + txtstate.text.replace(" ", "+") + "+" + txtzip.text.replace(" ", "+")); webstreetview.navigate(urlstring); } } }
unfortunately form looks it's going through motions when "go" button clicked (i can see hourglass instant) webbrowser object remains blank.
here have done try test:
- plugged test url url property of object in design mode - form loads image
- pulled uri address out of app in debug , tested in browser - works fine
- per advice found similar problems, tried adding in call webbrowser.refresh() - no dice
- please note line "webstreetview = new webbrowser();" put in troubleshooting attempt per other comment.
it's simple i'm overlooking. if can point me in right direction , find i'm missing appreciated.
ok, figured out. apparently default margins (7,7,7,7) webbrowser object bare minimum (i had set them 0 in attempt show clean image no border).
for attempted answer question me in earnest, thank kindly.
for person downvoted question: go fish.
Comments
Post a Comment