private void ChangeCityClick_Click(object sender, EventArgs e) { counter++; if (counter % 2 == 0) { CityChangerBox.Hide(); pictureBox1.Hide(); } else { pictureBox1.Show(); CityChangerBox.Show(); } }
private void WeatherApp_Load(object sender, EventArgs e) { FileStream sb1 = new FileStream("City1.txt", FileMode.OpenOrCreate); StreamWriter sw1 = new StreamWriter(sb1); sw1.Close(); FileStream sb2 = new FileStream("City2.txt", FileMode.OpenOrCreate); StreamWriter sw2 = new StreamWriter(sb2); sw2.Close(); FileStream sb3 = new FileStream("City3.txt", FileMode.OpenOrCreate); StreamWriter sw3 = new StreamWriter(sb3); sw3.Close(); FileStream sb4 = new FileStream("City4.txt", FileMode.OpenOrCreate); StreamWriter sw4 = new StreamWriter(sb4); sw4.Close(); FileStream sb5 = new FileStream("City5.txt", FileMode.OpenOrCreate); StreamWriter sw5 = new StreamWriter(sb5); sw5.Close(); FileStream sb6 = new FileStream("City6.txt", FileMode.OpenOrCreate); StreamWriter sw6 = new StreamWriter(sb6); sw6.Close(); iconbox = pictureBox1; pictureBox1.Hide(); CityChangerBox.Hide(); RcityChanger = CityChangerBox; main = this; mapcontrol.Hide(); MainSize(749, 430); bools = new List <bool>() { first, two, three, four, five, six }; using (StreamReader st = new StreamReader("City1.txt")) { string text = st.ReadToEnd(); Boxes(text, FirstGroupBox, FirstIconBox, tempmax, tempmin, Wind1); } using (StreamReader st = new StreamReader("City2.txt")) { string text = st.ReadToEnd(); Boxes(text, SecondGroupBox, SecondIconBox, tempmax2, tempmin2, Wind2); } using (StreamReader st = new StreamReader("City3.txt")) { string text = st.ReadToEnd(); Boxes(text, ThirdGroupBox, ThirdIconBox, tempmax3, tempmin3, Wind3); } using (StreamReader st = new StreamReader("City4.txt")) { string text = st.ReadToEnd(); Boxes(text, FourthGroupBox, FourthIconBox, tempmax4, tempmin4, Wind4); } using (StreamReader st = new StreamReader("City5.txt")) { string text = st.ReadToEnd(); Boxes(text, FifthGroupBox, FifthIconBox, tempmax5, tempmin5, Wind5); } using (StreamReader st = new StreamReader("City6.txt")) { string text = st.ReadToEnd(); Boxes(text, SixthGroupBox, SixthIconBox, tempmax6, tempmin6, Wind6); } WeatherTimer.Start(); }