0
我想要得到一個長的描述,以適應我的printPreviewDialog文檔。但是,當我在文本框中鍵入描述並嘗試打印時,文本不會保留在文檔中。 Text not staying on document的,是造成這一問題的代碼行是最後一個 e.Graphics.DrawString("Description:" + description4Repair.Text, new Font("Arial", 15, FontStyle.Regular), Brushes.Black, new Point(50, 493));
如何讓文本適合printPreviewDialog文檔C#
所有代碼:
e.Graphics.DrawString("DEVICE INFORMATION:", new Font("Arial", 14, FontStyle.Regular), Brushes.Black, new Point(286, 373));
e.Graphics.DrawString("Device Type:" + devices.Text, new Font("Arial", 15, FontStyle.Regular), Brushes.Black, new Point(50, 403));
if (devices.Visible == true & devices.Text == "Console")
{
e.Graphics.DrawString("Type of Console:" + consoleTextBox.Text, new Font("Arial", 15, FontStyle.Regular), Brushes.Black, new Point(50, 433));
}
if (comboBox3.Visible == true) //iphone selection box is visible then show selected model on print document
{
e.Graphics.DrawString("Type of Phone:" + comboBox3.Text, new Font("Arial", 15, FontStyle.Regular), Brushes.Black, new Point(50, 433));
e.Graphics.DrawString("Service Type:" + serviceDesc.Text, new Font("Arial", 15, FontStyle.Regular), Brushes.Black, new Point(50, 463));
e.Graphics.DrawString("Description:" + description4Repair.Text, new Font("Arial", 15, FontStyle.Regular), Brushes.Black, new Point(50, 493));
```
你需要用你的文字中解釋[抽繩自動換行或顯示整個文本( https://stackoverflow.com/questions/9507842/drawstring-word-wrap-or-display-entire-text) –