Create a windows form application which consists of a List Box Control and four buttons. Add button
Fantastic news! We've Found the answer you've been seeking!
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 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);
}
Related Book For
Posted Date: