<INPUT onclick="javascript:print()" type="button" value="【打印】">

解决方案 »

  1.   

    private void printDocument1_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e)
    {
    string sContent = "Test Print";
    Font printTitleFont= new Font("Arial",8,FontStyle.Regular);
    StringFormat sLeft=new StringFormat();
    sLeft.Alignment=StringAlignment.Near;
    e.Graphics.DrawString(sContent,printTitleFont,Brushes.Black,new RectangleF(e.MarginBounds.Left, e.MarginBounds.Top, e.MarginBounds.Width, e.MarginBounds.Height),sLeft);
    }調用
    printDocument1.Print();