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; using System.Collections; namespace WindowsFormsApplication10 { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void Form1_Load(object sender, EventArgs e) { } private void richTextBox1_TextChanged(object sender, EventArgs e) { } private void kaydetToolStripMenuItem_Click(object sender, EventArgs e) { SaveFileDialog ofd = new SaveFileDialog(); ofd.Filter = "Text Dosyaları|*.txt"; DialogResult cevap = ofd.ShowDialog(); if (cevap == DialogResult.OK) { richTextBox1.SaveFile(ofd.FileName, RichTextBoxStreamType.PlainText); } } private void açToolStripMenuItem_Click(object sender, EventArgs e) { OpenFileDialog ofd = new OpenFileDialog(); ofd.Filter = "Text Dosyaları|*.txt"; DialogResult cevap = ofd.ShowDialog(); if (cevap == DialogResult.OK) { richTextBox1.LoadFile(ofd.FileName, RichTextBoxStreamType.PlainText); } } private void yeniToolStripMenuItem_Click(object sender, EventArgs e) { } private void yazdırToolStripMenuItem_Click(object sender, EventArgs e) { PrintDialog pd = new PrintDialog(); DialogResult cevap = pd.ShowDialog(); if (cevap == DialogResult.OK) { printDocument1.Print(); } } private void kesToolStripMenuItem_Click(object sender, EventArgs e) { richTextBox1.Cut(); yapıştırToolStripMenuItem.Enabled = true; } private void kopyalaToolStripMenuItem_Click(object sender, EventArgs e) { richTextBox1.Copy(); } private void yapıştırToolStripMenuItem_Click(object sender, EventArgs e) { richTextBox1.Paste(); } private void çıkışToolStripMenuItem_Click(object sender, EventArgs e) { DialogResult cevap = MessageBox.Show("Çıkmak istiyormusunuz?", "Çıkış", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (cevap == DialogResult.Yes) { this.Close(); } else if (cevap == DialogResult.No) { MessageBox.Show("İşlem İptal Edildi"); } } private void yazıTipiToolStripMenuItem_Click(object sender, EventArgs e) { FontDialog fd = new FontDialog(); if (fd.ShowDialog() == DialogResult.OK) { richTextBox1.Font = fd.Font; } } private void renkToolStripMenuItem_Click(object sender, EventArgs e) { ColorDialog cd = new ColorDialog(); if (cd.ShowDialog() == DialogResult.OK) { richTextBox1.SelectionColor = cd.Color; } } } }