Advertisement
BloodMoonYTC

MenuSzovegszerkeszto

Feb 14th, 2022
1,069
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.90 KB | None | 0 0
  1. namespace MenuSzovegszerkeszto
  2. {
  3.     public partial class Form1 : Form
  4.     {
  5.         public Form1()
  6.         {
  7.             InitializeComponent();
  8.         }
  9.  
  10.         private void undoToolStripMenuItem_Click(object sender, EventArgs e)
  11.         {
  12.  
  13.         }
  14.  
  15.         private void kilepToolStripMenuItem_Click(object sender, EventArgs e)
  16.         {
  17.             if (MessageBox.Show("Tenyleg ki akarsz lepni?", "Kilepes",
  18.             MessageBoxButtons.OKCancel) == DialogResult.OK)
  19.                 Application.Exit();
  20.         }
  21.  
  22.         private void undoToolStripMenuItem_Click_1(object sender, EventArgs e)
  23.         {
  24.             if (textBox1.CanUndo == true)
  25.             {
  26.                 textBox1.Undo();
  27.                 textBox1.ClearUndo();
  28.             }
  29.         }
  30.  
  31.         private void cutToolStripMenuItem_Click(object sender, EventArgs e)
  32.         {
  33.             textBox1.Cut();
  34.         }
  35.  
  36.         private void copyToolStripMenuItem_Click(object sender, EventArgs e)
  37.         {
  38.             if (textBox1.SelectionLength > 0)
  39.             {
  40.                 textBox1.Copy();
  41.             }
  42.         }
  43.  
  44.         private void pasteToolStripMenuItem_Click(object sender, EventArgs e)
  45.         {
  46.             if (Clipboard.GetDataObject().GetDataPresent(DataFormats.Text) == true)
  47.             {
  48.                 textBox2.Paste();
  49.                 Clipboard.Clear();
  50.             }
  51.         }
  52.  
  53.         private void viewTextBoxesToolStripMenuItem_Click(object sender, EventArgs e)
  54.         {
  55.             viewTextBoxesToolStripMenuItem.Checked = !viewTextBoxesToolStripMenuItem.Checked;
  56.             if (viewTextBoxesToolStripMenuItem.Checked)
  57.             {
  58.                 textBox1.Visible = true;
  59.                 textBox2.Visible = true;
  60.             }
  61.             else
  62.             {
  63.                 textBox1.Visible = false;
  64.                 textBox2.Visible = false;
  65.             }
  66.         }
  67.     }
  68. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement