Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows.Forms;
- namespace WindowsFormsApplication1
- {
- public partial class Form1 : Form
- {
- public Form1()
- {
- InitializeComponent();
- }
- private void exitToolStripMenuItem_Click(object sender, EventArgs e)
- {
- Application.Exit();
- }
- private void newToolStripMenuItem_Click(object sender, EventArgs e)
- {
- richTextBox1.Clear();
- this.Text = "New File";
- }
- private void openToolStripMenuItem_Click(object sender, EventArgs e)
- {
- OpenFileDialog open = new OpenFileDialog();
- if (open.ShowDialog() == DialogResult.OK)
- {
- richTextBox1.LoadFile(open.FileName, RichTextBoxStreamType.PlainText);
- }
- this.Text = open.FileName;
- }
- private void saveToolStripMenuItem_Click(object sender, EventArgs e)
- {
- SaveFileDialog save = new SaveFileDialog();
- save.Filter="Text Document (*.txt)|*.txt|All Files (*.*)|*.*";
- if (save.ShowDialog() == DialogResult.OK)
- {
- richTextBox1.SaveFile(save.FileName, RichTextBoxStreamType.PlainText);
- }
- this.Text = save.FileName;
- }
- private void cutToolStripMenuItem_Click(object sender, EventArgs e)
- {
- richTextBox1.Cut();
- }
- private void copyToolStripMenuItem_Click(object sender, EventArgs e)
- {
- richTextBox1.Copy();
- }
- private void pasteToolStripMenuItem_Click(object sender, EventArgs e)
- {
- richTextBox1.Paste();
- }
- private void undoToolStripMenuItem_Click(object sender, EventArgs e)
- {
- richTextBox1.Undo();
- }
- private void redoToolStripMenuItem_Click(object sender, EventArgs e)
- {
- richTextBox1.Redo();
- }
- private void fontToolStripMenuItem1_Click(object sender, EventArgs e)
- {
- FontDialog font = new FontDialog();
- font.Font = richTextBox1.SelectionFont;
- if (font.ShowDialog() == DialogResult.OK)
- {
- richTextBox1.SelectionFont = font.Font;
- }
- }
- private void aboutToolStripMenuItem_Click(object sender, EventArgs e)
- {
- MessageBox.Show("Version: 1.1.0\nCreated by: Akkerman Tamás\n\nYou can contact me on e-mail: akkermantamas27@hotmail.com");
- }
- private void textBoxToolStripMenuItem_Click(object sender, EventArgs e)
- {
- ColorDialog backcolor = new ColorDialog();
- if (backcolor.ShowDialog() == DialogResult.OK)
- {
- richTextBox1.BackColor = backcolor.Color;
- }
- }
- private void numbersToolStripMenuItem_Click(object sender, EventArgs e)
- {
- ColorDialog backcolor = new ColorDialog();
- if (backcolor.ShowDialog() == DialogResult.OK)
- {
- lineNumbers.BackColor = backcolor.Color;
- }
- }
- private void patchNotesToolStripMenuItem_Click(object sender, EventArgs e)
- {
- string file_path = "\\Notepad\\patch.txt";
- file_path = Environment.GetFolderPath(Environment.SpecialFolder.Desktop) + file_path;
- System.IO.StreamReader patch = new System.IO.StreamReader(file_path);
- MessageBox.Show(patch.ReadToEnd(),"Patch Notes");
- }
- private void TextChange(object sender, EventArgs e)
- {
- //Allign
- int rtbleft = richTextBox1.Left;
- int lnleft = lineNumbers.Width;
- rtbleft = lnleft; rtbleft++;
- richTextBox1.Left = rtbleft;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement