Skip to content

Instantly share code, notes, and snippets.

@aysegulsarikaya
Created April 7, 2019 15:01
Show Gist options
  • Select an option

  • Save aysegulsarikaya/e9dea72ae08e70b461f76457c43ebb91 to your computer and use it in GitHub Desktop.

Select an option

Save aysegulsarikaya/e9dea72ae08e70b461f76457c43ebb91 to your computer and use it in GitHub Desktop.
public Queue<string> liste = new Queue<string>();
private void txtCopy_KeyDown(object sender, KeyEventArgs e)
{
if (e.Control && e.KeyCode == Keys.C)
{
if ((!string.IsNullOrEmpty(txtCopy.Text)) && (!liste.Contains(txtCopy.Text)))
{
liste.Enqueue(txtCopy.Text);
}
}
}
private void txtPaste_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyData == (Keys.Control | Keys.V))
{
Clipboard.Clear();
txtPaste.Clear();
txtPaste.Text = liste.Dequeue();
liste.Enqueue(txtPaste.Text);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment