Created
April 7, 2019 14:31
-
-
Save aysegulsarikaya/9225d43fc8d7018a2d61a8b129508d08 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public List<string> list = new List<string>(); | |
| public int i = 0; | |
| private void txtCopy_KeyDown(object sender, KeyEventArgs e) | |
| { | |
| if (e.Control && e.KeyCode == Keys.C) | |
| { | |
| if ((!string.IsNullOrEmpty(txtCopy.Text)) && (!list.Contains(txtCopy.Text))) | |
| list.Add(txtCopy.Text); | |
| } | |
| } | |
| private void txtPaste_KeyDown(object sender, KeyEventArgs e) | |
| { | |
| if (e.KeyData == (Keys.Control | Keys.V)) | |
| { | |
| if (list.Count - 1 >= i) | |
| { | |
| Clipboard.Clear(); | |
| txtPaste.Clear(); | |
| txtPaste.Text = list[i].ToString(); | |
| i++; | |
| } | |
| if (list.Count == i) | |
| { | |
| i = 0; | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment