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 listbox
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void addButton_Click(object sender, EventArgs e)
{
displayListBox.Items.Add(inputTextbox.Text);
inputTextbox.Clear();
}
private void RemoveBtn_Click(object sender, EventArgs e)
{
if (displayListBox.SelectedIndex != -1)
displayListBox.Items.RemoveAt(
displayListBox.SelectedIndex);
}
private void ClearBtn_Click(object sender, EventArgs e)
{
displayListBox.Items.Clear();
}
private void ExitBtn_Click(object sender, EventArgs e)
{
Application.Exit();
}
}
}
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace listbox
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void addButton_Click(object sender, EventArgs e)
{
displayListBox.Items.Add(inputTextbox.Text);
inputTextbox.Clear();
}
private void RemoveBtn_Click(object sender, EventArgs e)
{
if (displayListBox.SelectedIndex != -1)
displayListBox.Items.RemoveAt(
displayListBox.SelectedIndex);
}
private void ClearBtn_Click(object sender, EventArgs e)
{
displayListBox.Items.Clear();
}
private void ExitBtn_Click(object sender, EventArgs e)
{
Application.Exit();
}
}
}
// output
No comments:
Post a Comment