Question: Create a windows form application which consists of a List Box Control and four buttons. Add button : Adds items to the list box Remove

Create a windows form application which consists of a List Box Control and four buttons.

Add button: Adds items to the list box

ListBoxTest Dog Cat Chicken Cont Add Remove Clear Exit GRemove button: Removes selected items from the list

Clear button: Empties the list

Exit button:Closes the form

private void btnAdd(object sender, EventArgs e)

{

string s = textBox1.Text;

listBox1.Items.Add(s);

}

private void btnRemove(object sender, EventArgs e)

{

if (listBox1.SelectedIndex != -1)

listBox1.Items.RemoveAt(listBox1.SelectedIndex);

}


ListBoxTest Dog Cat Chicken Cont Add Remove Clear Exit G

Step by Step Solution

3.39 Rating (155 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Solution Code Form1cs using System using SystemCollectionsGeneric using SystemComponentModel using SystemData using SystemDrawing using SystemLinq using SystemText using SystemThreadingTasks using Sys... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!