string[] img = Directory.GetFiles("C:\\Users\\Public\\Pictures\\Sample Pictures","*.*"); listBox1.Items.AddRange(img);
private void button1_Click(object sender, EventArgs e) { pos--; if (pos < listBox1.Items.Count - 1) { button2.Enabled = true; } listBox1.SelectedIndex = pos; if (pos == 0) button1.Enabled = false; }
private void button2_Click(object sender, EventArgs e) { pos++; if (pos > 0) button1.Enabled = true; listBox1.SelectedIndex = pos; if (pos == listBox1.Items.Count - 1) button2.Enabled = false; }
private void button3_Click(object sender, EventArgs e) { if (button3.Text == "SlideShow") { button3.Text = "Stop Show"; timer1.Interval = int.Parse(comboBox1.Text) * 1000; timer1.Start(); } else { button3.Text = "SlideShow"; timer1.Stop(); } }