/*Metoda pro tisk obsahu textového pole vyvolána tlačítkem tiskárna, * nikoliv tlačítkem náhled (pracuje s jiným dialogovým oknem)*/ private void doc_PrintPage(object sender, PrintPageEventArgs e) { int x = 10; int y = 0; int charpos = 0; while (charpos < TextBoxInterface.Text.Length) { if (TextBoxInterface.Text[charpos] == '\n') { charpos++; y += 20; x = 10; } else if (TextBoxInterface.Text[charpos] == '\r') { charpos++; } else { TextBoxInterface.Select(charpos, 1); e.Graphics.DrawString(TextBoxInterface.SelectedText, TextBoxInterface.SelectionFont, new SolidBrush(TextBoxInterface.SelectionColor), new PointF(x, y)); x = x + 8; charpos++; } } }