You are doing it wrong. What you have done is, the
stringbuilder
is appending the same text over and over again with each increment in for loop. I have fixed the code for you.
Note: use of
stringbuilder
is not required.
private void textBox1_KeyPress(object sender, KeyPressEventArgs e)
{
if (e.KeyChar == (Char)Keys.Enter)
{
City = txtPhyCity.Text;
string openupdate = "http://maps.googleapis.com/maps/api/staticmap?center="+City+"&zoom=14&size=400x400&sensor=false";
mapbrowser.Navigate(OpenUpdate);
}
}