ComboBox’ta seçilen isme göre pictureBox’ta resim görüntüleme — C#

ComboBox’ta seçilen isme göre pictureBox’ta resim görüntüleme — C#

[code lang=”csharp”]

using System;

using System.Collections.Generic;

using System.ComponentModel;

using System.Data;

using System.Drawing;//www.gorselprogramlama.com

using System.Linq;

using System.Text;

using System.Windows.Forms;

namespace combo_secilene_gore_resim

{

public partial class Form1 : Form

{

public Form1()

{

InitializeComponent();//www.gorselprogramlama.com

}

private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)

{

if (comboBox1.Text == "Lüfer") pictureBox1.ImageLocation = "lufer.jpg";

else if (comboBox1.Text == "Çupra") pictureBox1.ImageLocation = "cupra.jpg";

else if (comboBox1.Text == "Hamsi") pictureBox1.ImageLocation = "hamsi.jpg";//www.gorselprogramlama.com

else if (comboBox1.Text == "Mezgit") pictureBox1.ImageLocation = "mezgit.jpg";

else if (comboBox1.Text == "Seçiniz") pictureBox1.ImageLocation = "";

else MessageBox.Show("Listede muvcut değil !");//www.gorselprogramlama.com

}

}

}

[/code]

Projeyi İNDİR

Yorumlar 6

Bir yanıt yazın

E-posta adresiniz yayınlanmayacak. Gerekli alanlar * ile işaretlenmişlerdir