18 Temmuz 2008 Cuma

C# Film Afişi Seçimi


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 DizilerTekrar
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
string[] filmisimleri;
private void button1_Click(object sender, EventArgs e)
{
comboBox1.Text = "";
filmisimleri = new string[] {"Baba","Hızlı ve Öfkeli","Karayip Korsanları","Titanic","Kusursuz Fırtına","Hababam Sınıfı","Maskeki Beşler"};

foreach(string film in filmisimleri)
{
comboBox1.Items.Add(film);
}

}
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
{

pictureBox1.Image = mageList1.Images[comboBox1.SelectedIndex];

}
private void btnAranan_Click(object sender, EventArgs e)
{
int index = Array.IndexOf(filmisimleri, txtAranan.Text);
if (index == -1)
{
MessageBox.Show("Bu Film Sinemamızda Bulunmamaktadır.");
}
else
{

comboBox1.SelectedIndex = index;
pictureBox1.Image = mageList1.Images[index];
}
}
}
}

Hiç yorum yok: