using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; namespace WindowsFormsApplication1 { public partial class Form2 : Form { public Form2() { InitializeComponent(); } private void toolStripMenuItem2_Click(object sender, EventArgs e) { SaveFileDialog sfd = new SaveFileDialog(); sfd.Filter = "Text Dosyası |*.txt| Tüm Dosyalar |*.*"; DialogResult cevap = sfd.ShowDialog(); if (cevap == DialogResult.OK) { txtEditor.SaveFile(sfd.FileName, RichTextBoxStreamType.PlainText); } } private void checkBox1_CheckedChanged(object sender, EventArgs e) { if(checkBox1.Checked) { OpenFileDialog ofd = new OpenFileDialog(); ofd.Filter = "Text Dosyaları |*.txt"; DialogResult cevap= ofd.ShowDialog(); if(cevap==DialogResult.OK) { txtEditor.LoadFile(ofd.FileName,RichTextBoxStreamType.PlainText); button2.Visible = true; } } } private void button2_Click(object sender, EventArgs e) { PrintDialog pd = new PrintDialog(); DialogResult cevap = pd.ShowDialog(); if (cevap == DialogResult.OK) { belge.Print(); } Form3 form3 = new Form3(); form3.ShowDialog(); } private void Form2_Load(object sender, EventArgs e) { button2.Visible = false; } private void belge_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e) { e.Graphics.DrawString(txtEditor.Text, txtEditor.Font, Brushes.Black, new Point(100, 100)); this.Hide(); } } }