我正在尝试MSDN使用PrintDocument打印的例子,但它并不是那么顺利.我已经完成了所有编译,但是当我点击打印时,会弹出"传真发送设置"窗口.这应该发生吗?我想打印,而不是发传真!
我需要更改什么才能直接打印到默认打印机?
谢谢!
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.IO;
using System.Drawing.Printing;
namespace WindowsFormsApplication1
{
public partial class Form4 : System.Windows.Forms.Form
{
private System.ComponentModel.Container components;
private System.Windows.Forms.Button printButton;
private Font printFont;
private StreamReader streamToPrint;
public Form4()
{
// The Windows Forms Designer requires the following call.
InitializeComponent();
}
// The Click event is raised when the user clicks the Print button.
private void printButton_Click(object sender, EventArgs e) …Run Code Online (Sandbox Code Playgroud)