im using visual studio to make a minimal image viewer and i want to be able to open up an image from any directory and use the arrow keys to go through all of the images in that directory. my code so far includes an open image button but i would like to just use the file explorer to go and open up that image then cycle through all of the images in the directory.
public Form1()
{
InitializeComponent();
}
private void pictureBox1_Click(object sender, EventArgs e)
{
}
private void openToolStripMenuItem_Click(object sender, EventArgs e)
{
OpenFileDialog ofd = new OpenFileDialog();
ofd.Filter = "Image files (*.jpg, *.jpeg, *.jpe, *.jfif, *.png, *.gif) | *.jpg; *.jpeg; *.jpe; *.jfif; *.png; *.gif" ;
if (ofd.ShowDialog()==DialogResult.OK && ofd.FileName.Length > 0)
{
pictureBox1.SizeMode = PictureBoxSizeMode.AutoSize;
pictureBox1.Image = Image.FromFile(ofd.FileName);
}
}
private void saveToolStripMenuItem_Click(object sender, EventArgs e)
{
}