private void SearchIcon_Click(object sender, EventArgs e) { if (maporweather == false) { SecondGroupBox.Hide(); ThirdGroupBox.Hide(); FourthGroupBox.Hide(); FifthGroupBox.Hide(); SixthGroupBox.Hide(); if (WeatherInformation(Search.Text).Result.name != "") { Boxes(Search.Text, FirstGroupBox, FirstIconBox, tempmax, tempmin, Wind1); lon = WeatherInformation(FirstGroupBox.Text).Result.Rlon; lat = WeatherInformation(FirstGroupBox.Text).Result.Rlat; } else { FirstGroupBox.Hide(); } YN = true; } else { using (StreamReader st = new StreamReader("City1.txt")) { string text = st.ReadToEnd(); if (WeatherInformation(text).Result.name != "") { Boxes(text, FirstGroupBox, FirstIconBox, tempmax, tempmin, Wind1); lon = WeatherInformation(Search.Text).Result.Rlon; lat = WeatherInformation(Search.Text).Result.Rlat; } else { } } YN = true; } }