Advertisement
Guest User

Untitled

a guest
Oct 21st, 2019
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.71 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. using System.Windows.Forms;
  10.  
  11. namespace MevEditor
  12. {
  13. public partial class Form1 : Form
  14. {
  15. public Form1()
  16. {
  17. InitializeComponent();
  18. }
  19.  
  20. private void editatToolStripMenuItem_Click(object sender, EventArgs e)
  21. {
  22.  
  23. }
  24.  
  25. private void desfazerToolStripMenuItem_Click(object sender, EventArgs e)
  26. {
  27. richTextBox1.Undo();
  28. }
  29.  
  30. private void refazerToolStripMenuItem_Click(object sender, EventArgs e)
  31. {
  32. richTextBox1.Redo();
  33. }
  34.  
  35. private void recortarToolStripMenuItem_Click(object sender, EventArgs e)
  36. {
  37. richTextBox1.Cut();
  38. }
  39.  
  40. private void copiarToolStripMenuItem_Click(object sender, EventArgs e)
  41. {
  42. richTextBox1.Copy();
  43. }
  44.  
  45. private void colarToolStripMenuItem_Click(object sender, EventArgs e)
  46. {
  47. richTextBox1.Paste();
  48. }
  49.  
  50. private void selecionarTudoToolStripMenuItem_Click(object sender, EventArgs e)
  51. {
  52. richTextBox1.SelectAll();
  53. }
  54.  
  55. private void corToolStripMenuItem_Click(object sender, EventArgs e)
  56. {
  57. if (dlgcor.ShowDialog() == DialogResult.OK)
  58. {
  59. richTextBox1.ForeColor = dlgcor.Color;
  60. }
  61. }
  62.  
  63. private void corDeFundoToolStripMenuItem_Click(object sender, EventArgs e)
  64. {
  65. if (dlgcor.ShowDialog() == DialogResult.OK)
  66. {
  67. richTextBox1.BackColor = dlgcor.Color;
  68. }
  69. }
  70.  
  71. private void fonteToolStripMenuItem_Click(object sender, EventArgs e)
  72. {
  73. if( dlgfonte.ShowDialog() == DialogResult.OK)
  74. {
  75. richTextBox1.Font = dlgfonte.Font;
  76. }
  77. }
  78.  
  79. private void salvarToolStripMenuItem_Click(object sender, EventArgs e)
  80. {
  81. dlgsalvar.Title = "Salvar";
  82.  
  83. dlgsalvar.Filter = "Rich Text Files (*.rtf)|*.rtf";
  84.  
  85. if (dlgsalvar.ShowDialog() == DialogResult.OK)
  86. {
  87.  
  88. richTextBox1.SaveFile(dlgsalvar.FileName, RichTextBoxStreamType.RichText);
  89.  
  90. }
  91. }
  92.  
  93. private void abrirToolStripMenuItem_Click(object sender, EventArgs e)
  94. {
  95. try
  96. {
  97.  
  98. dlgabrir.Title = "Abrir";
  99.  
  100. dlgabrir.Filter = "Rich Text Files (*.rtf)|*.rtf";
  101.  
  102. if (dlgabrir.ShowDialog() == DialogResult.OK)
  103. {
  104.  
  105. richTextBox1.LoadFile(dlgabrir.FileName);
  106.  
  107. }
  108.  
  109. }
  110.  
  111. catch (Exception)
  112. {
  113.  
  114. MessageBox.Show("Erro ao Abrir");
  115.  
  116. }
  117. }
  118.  
  119. private void timer1_Tick(object sender, EventArgs e)
  120. {
  121. toolStripStatusLabel4.Text = DateTime.Now.ToLongTimeString();
  122. toolStripStatusLabel2.Text = DateTime.Now.ToShortDateString();
  123. }
  124.  
  125. private void richTextBox1_TextChanged(object sender, EventArgs e)
  126. {
  127.  
  128. }
  129.  
  130. private void sairToolStripMenuItem_Click(object sender, EventArgs e)
  131. {
  132. if (MessageBox.Show("Deseja sair?", "Sair", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
  133. {
  134. this.Close();
  135. }
  136. }
  137.  
  138. private void novoToolStripMenuItem_Click(object sender, EventArgs e)
  139. {
  140. richTextBox1.Clear();
  141. }
  142. }
  143. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement