Uygulama 3
private void pictureBox1_DoubleClick(object sender,
EventArgs e)
{
openFileDialog1.ShowDialog();
pictureBox1.Image =
Image.FromFile(openFileDialog1.FileName);
textBox3.Text = openFileDialog1.FileName;
}
private void button1_Click(object sender,
EventArgs e)
{
listBox1.Items.Add(textBox1.Text);
listBox2.Items.Add(textBox2.Text);
listBox3.Items.Add(textBox3.Text);
}
public static int i = 0;
private void timer1_Tick(object sender,
EventArgs e)
{
try
{
if (listBox1.Items.Count != 0)
{
pictureBox2.Image =
Image.FromFile(listBox3.Items[i].ToString());
label4.Text =
listBox1.Items[i].ToString();
label5.Text =
listBox2.Items[i].ToString();
}
i = i + 1;
if (i >= listBox1.Items.Count)
{
i = 0;
}
}
catch
{
timer1.Enabled = false;
DialogResult cevap;
cevap = MessageBox.Show("Hata!! Devam
edilsin mi?", "Hata Kontrol", MessageBoxButtons.YesNo,
MessageBoxIcon.Question);
if (cevap==DialogResult.Yes)
{
timer1.Enabled = true;
i = i + 1;
if (i >= listBox1.Items.Count)
{
i = 0;
}
}
else
{
Application.Exit();
}
}
}
Download

Timer