using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
int sira = -1;
public Form1()
{
InitializeComponent();
}
Image[] resimler = new Image[4];
private void pictureBox2_Click(object sender, EventArgs e)
{
}
private void pictureBox3_Click(object sender, EventArgs e)
{
}
private void pictureBox4_Click(object sender, EventArgs e)
{
}
private void pictureBox5_Click(object sender, EventArgs e)
{
}
private void Form1_Load(object sender, EventArgs e)
{
resimler[0] = Image.FromFile("C:\\Türk.png");
resimler[1] = Image.FromFile("C:\\alman.png");
resimler[2] = Image.FromFile("C:\\ispanya.png");
resimler[3] = Image.FromFile("C:\\italya.png");
pictureBox2.Image = Image.FromFile("C:\\Türk.png");
pictureBox3.Image = Image.FromFile("C:\\alman.png");// Burada C ye attığımız resi mleri alıyoruz.
pictureBox4.Image = Image.FromFile("C:\\ispanya.png");
pictureBox5.Image = Image.FromFile("C:\\italya.png");
}
private void button6_Click(object sender, EventArgs e)
{
pictureBox1.Image = Image.FromFile("C:\\Türk.png");
timer1.Stop();
if (sira < 1)
{
sira = resimler.Count() - 1;
}
else
{
sira--;
}
pictureBox1.Image = resimler[sira];
}
private void button5_Click(object sender, EventArgs e)
{
pictureBox1.Image = Image.FromFile("c:\\Türk.png");
}
private void button9_Click(object sender, EventArgs e)
{
pictureBox1.Image = Image.FromFile("c:\\italya.png");
}
private void button7_Click(object sender, EventArgs e)
{
timer1.Interval = 1000;
timer1.Start();
if (button7.Text == "Slayt")
{
button7.Text = "durdur";
}
else
{
timer1.Stop();
button7.Text = "slayt";
}
}
private void pictureBox1_Click(object sender, EventArgs e)
{
}
private void button8_Click(object sender, EventArgs e)
{
if (sira >= 3)
{
sira = 0;
}
else
{
sira++;
}
pictureBox1.Image = resimler[sira];
}
private void timer1_Tick(object sender, EventArgs e)
{
try
{
sira++;
pictureBox1.Image = resimler[sira];
}
catch (Exception)
{
sira = -1;
}
}
}
}
Hiç yorum yok:
Yorum Gönder