Queue(Enqueue and Dequeue)......
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace WindowsFormsApplication1
{
public partial class queue : Form
{
public queue()
{
InitializeComponent();
}
Queue<string> qu = new Queue<string>();
private void btnen_Click(object sender, EventArgs e)
{
qu.Enqueue(textBox1.Text);
listBox1.Items.Add(textBox1.Text);
textBox1.Text = "";
}
private void btnde_Click(object sender, EventArgs e)
{
listBox1.Items.RemoveAt(0);
listBox1.Refresh();
}
}
}
Category: