Assert.That(picbox.SizeMode, Is.EqualTo(PictureBoxSizeMode.Zoom));
Assert.That(picbox.WaitOnLoad, Is.False);
Assert.That(picbox.Dock, Is.EqualTo(DockStyle.Fill));
- Assert.That(picbox.Visible, Is.False);
picbox.Dispose();
}
num++;
}
+ Assert.That(thumbbox.Controls, Is.EquivalentTo(new Control[]{ thumbbox.scrollBar }.Concat(thumbbox.pictureBox)));
+
Assert.That(thumbbox.scrollBar.Minimum, Is.EqualTo(0));
Assert.That(thumbbox.scrollBar.Maximum, Is.EqualTo(count));
}
cancelToken.ThrowIfCancellationRequested();
}
- this.pictureBox[0].Visible = true;
this.scrollBar.Maximum = thumbnails.Count - 1;
if (thumbnails.Count > 1)
for (int i = 0; i < count; i++)
{
var picbox = CreatePictureBox("pictureBox" + i);
+ picbox.Visible = (i == 0);
picbox.DoubleClick += this.pictureBox_DoubleClick;
this.Controls.Add(picbox);
SizeMode = PictureBoxSizeMode.Zoom,
WaitOnLoad = false,
Dock = DockStyle.Fill,
- Visible = false,
};
}
private void scrollBar_ValueChanged(object sender, EventArgs e)
{
+ this.SuspendLayout();
for (var i = 0; i < this.pictureBox.Count; i++)
{
var picbox = this.pictureBox[i];
+ Console.WriteLine(this.scrollBar.Value + ", " + i);
if (this.scrollBar.Value == i)
picbox.Visible = true;
else
picbox.Visible = false;
}
+ this.ResumeLayout(false);
+ }
+
+ private void ShowPictureBox(int index)
+ {
+ foreach (Control control in this.Controls)
+ {
+ if (control is PictureBox)
+ this.Controls.Remove(control);
+ }
+
+ this.Controls.Add(this.pictureBox[index]);
}
private void pictureBox_DoubleClick(object sender, EventArgs e)