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 test
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
listBox1.Items.Add("izmir");
listBox1.Items.Add("istanbul");
listBox1.Items.Add("aydın");
listBox1.Items.Add("manisa");
listBox2.Items.Add("ankara");
}
private void button1_Click(object sender, EventArgs e)
{
if (listBox1.SelectedItem == null)
MessageBox.Show("Please select an item from listBox1.");
else
{
listBox2.Items.Add(listBox1.SelectedItem.ToString());
listBox1.Items.Remove(listBox1.SelectedItem);
}
}
private void button2_Click(object sender, EventArgs e)
{
if (listBox2.SelectedItem == null)
MessageBox.Show("Please select an item from listBox2.");
else
{
listBox1.Items.Add(listBox2.SelectedItem.ToString());
listBox2.Items.Remove(listBox2.SelectedItem);
}
}
}
}
yur
erkanurr@hotmail.com