Using Using Using Using Using Using Using Using Using Namespace Public Partial Class Public

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 2

using System;

using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace WindowsFormsApplication7
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}

private void button1_Click(object sender, EventArgs e)


{
if (l1.SelectedIndex != -1)
{
l2.Items.Add(l1.SelectedItem);
l1.Items.Remove(l1.SelectedItem);
}
else
{
MessageBox.Show("NO Item is selected");
}
}

private void button3_Click(object sender, EventArgs e)


{
if (l2.SelectedIndex != -1)
{
l1.Items.Add(l2.SelectedItem);
l2.Items.Remove(l2.SelectedItem);
}
else
{
MessageBox.Show("NO Item is selected");
}
}

private void button2_Click(object sender, EventArgs e)


{
for (int i = 0; i < l1.Items.Count; i++)
{

l2.Items.Add(l1.Items[i].ToString());
}

l1.Items.Clear();

private void button4_Click(object sender, EventArgs e)


{
for (int i = 0; i < l2.Items.Count; i++)
{

l1.Items.Add(l2.Items[i].ToString());
}

l2.Items.Clear();
}

private void button1_MouseEnter(object sender, EventArgs e)


{
button1.BackColor = Color.Blue;
}

private void button1_MouseLeave(object sender, EventArgs e)


{
button1.BackColor = Color.Transparent;
}

private void button2_MouseEnter(object sender, EventArgs e)


{
button2.BackColor = Color.Red;
}

private void button2_MouseLeave(object sender, EventArgs e)


{
button2.BackColor = Color.Transparent;
}

private void button3_MouseEnter(object sender, EventArgs e)


{
button3.BackColor = Color.Green;
}

private void button3_MouseLeave(object sender, EventArgs e)


{
button3.BackColor = Color.Transparent;
}

private void button4_MouseEnter(object sender, EventArgs e)


{
button4.BackColor = Color.Yellow;
}

private void button4_MouseLeave(object sender, EventArgs e)


{
button4.BackColor = Color.Transparent;
}

private void Form1_Load(object sender, EventArgs e)


{

}
}
}

You might also like