private void buttonCopy_Click(object sender, EventArgs e) { TextCopy getLine = new TextCopy(); labelCopyStatus.Text = getLine.GetCurrentLine(textToCopy.Text); labelCurrentLineNum.Text = TextCopy._lineNum.ToString(); }
protected override void WndProc(ref Message m) { // Catch when a HotKey is pressed if (m.Msg == 0x0312) { int id = m.WParam.ToInt32(); // MessageBox.Show(string.Format("Hotkey #{0} pressed", id)); // Handle what will happen once a respective hotkey is pressed switch (id) { case 1: TextCopy prevLine = new TextCopy(); prevLine.GetPreviousLine(FormMain.GetRichText()); break; case 2: TextCopy getLine = new TextCopy(); getLine.GetCurrentLine(FormMain.GetRichText()); break; case 3: TextCopy nextLine = new TextCopy(); nextLine.GetNextLine(FormMain.GetRichText()); break; case 4: TextCopy copyOwnTextOne = new TextCopy(); copyOwnTextOne.CopyOwnText(FormMain.GetOwnTexts()[0]); break; case 5: TextCopy copyOwnTextTwo = new TextCopy(); copyOwnTextTwo.CopyOwnText(FormMain.GetOwnTexts()[1]); break; } } base.WndProc(ref m); }