private void setImage() { if (fi.Count > 0) { pictureBox1.ImageLocation = fi[pos].FullName; toolStripStatusLabel1.Text = fi[pos].Name; toolStripStatusLabel2.Text = (pos + 1).ToString() + @"/" + fi.Count; if (fi.Count > 1) { pictureBox2.ImageLocation = fi[pos + 1].FullName; } if (fi.Count > 2) { pictureBox3.ImageLocation = fi[pos + 2].FullName; } if (fi.Count > 3) { pictureBox4.ImageLocation = fi[pos + 3].FullName; } FS.updateFS(); } else { pictureBox1.ImageLocation = ""; pictureBox2.ImageLocation = ""; pictureBox3.ImageLocation = ""; pictureBox4.ImageLocation = ""; toolStripStatusLabel1.Text = ""; toolStripStatusLabel2.Text = @"0/0"; toolStripProgressBar1.Maximum = 100; toolStripProgressBar1.Value = 100; FS.updateFS(); } }
private void setImage() { if (fi.Count > 0) { if (!(bool)pictureBox2.Tag || pictureBox2.ImageLocation.Equals("") || !fi[pos].FullName.Equals(pictureBox2.ImageLocation)) { pictureBox1.ImageLocation = fi[pos].FullName; } else { PictureBox temp = pictureBox1; pictureBox1 = pictureBox2; pictureBox1.BringToFront(); pictureBox2 = temp; } _pos = pos + 1; if (_pos >= fi.Count) { _pos = 0; } pictureBox2.Tag = false; if (pos == _pos) { pictureBox2.ImageLocation = ""; } else { pictureBox2.ImageLocation = fi[_pos].FullName; } if (!pictureBox2.ImageLocation.Equals("")) { pictureBox2.LoadAsync(); } toolStripStatusLabel1.Text = fi[pos].Name; toolStripStatusLabel2.Text = (pos + 1).ToString() + @"/" + fi.Count; FS.updateFS(); } else { pictureBox1.ImageLocation = ""; pictureBox2.ImageLocation = ""; toolStripStatusLabel1.Text = ""; toolStripStatusLabel2.Text = @"0/0"; toolStripProgressBar1.Maximum = 100; toolStripProgressBar1.Value = 100; FS.updateFS(); } }