예제 #1
0
 private void editButton_Click(object sender, EventArgs e)
 {
     foreach (ListViewItem listItem in citiesListView.SelectedItems)
     {
         EditWeatherCityForm cityForm = new EditWeatherCityForm();
         // Set current image location
         cityForm.SatteliteImage     = listItem.SubItems[2].Text;
         cityForm.TemperatureImage   = listItem.SubItems[3].Text;
         cityForm.UVIndexImage       = listItem.SubItems[4].Text;
         cityForm.WindsImage         = listItem.SubItems[5].Text;
         cityForm.HumidityImage      = listItem.SubItems[6].Text;
         cityForm.PrecipitationImage = listItem.SubItems[7].Text;
         DialogResult dialogResult = cityForm.ShowDialog(this);
         if (dialogResult == DialogResult.OK)
         {
             // Fetch selected image location
             listItem.SubItems[2].Text = cityForm.SatteliteImage;
             listItem.SubItems[3].Text = cityForm.TemperatureImage;
             listItem.SubItems[4].Text = cityForm.UVIndexImage;
             listItem.SubItems[5].Text = cityForm.WindsImage;
             listItem.SubItems[6].Text = cityForm.HumidityImage;
             listItem.SubItems[7].Text = cityForm.PrecipitationImage;
         }
     }
 }
예제 #2
0
 private void editButton_Click(object sender, EventArgs e)
 {
   foreach (ListViewItem listItem in citiesListView.SelectedItems)
   {
     EditWeatherCityForm cityForm = new EditWeatherCityForm();
     // Set current image location
     cityForm.SatteliteImage = listItem.SubItems[2].Text;
     cityForm.TemperatureImage = listItem.SubItems[3].Text;
     cityForm.UVIndexImage = listItem.SubItems[4].Text;
     cityForm.WindsImage = listItem.SubItems[5].Text;
     cityForm.HumidityImage = listItem.SubItems[6].Text;
     cityForm.PrecipitationImage = listItem.SubItems[7].Text;
     DialogResult dialogResult = cityForm.ShowDialog(this);
     if (dialogResult == DialogResult.OK)
     {
       // Fetch selected image location
       listItem.SubItems[2].Text = cityForm.SatteliteImage;
       listItem.SubItems[3].Text = cityForm.TemperatureImage;
       listItem.SubItems[4].Text = cityForm.UVIndexImage;
       listItem.SubItems[5].Text = cityForm.WindsImage;
       listItem.SubItems[6].Text = cityForm.HumidityImage;
       listItem.SubItems[7].Text = cityForm.PrecipitationImage;
     }
   }
 }