0
我正在做一個帶有多個選項卡的Web瀏覽器,每個選項卡可能都會有一個與其他選項卡不同的新網站。 現在我想要做的是在特定的選項卡上打印頁面,並且當我嘗試打印時,該頁面可能包含多個頁面。 這是我的代碼,代碼的問題在於它只打印一頁,而最後一個選項卡已打開。任何建議:在特定選項卡中打印富文本框多頁C#
//this is the printDocemnt from the toolbox
private void printDocument1_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e)
{
Font font1 = new Font("Arial", 16, FontStyle.Regular);
e.Graphics.DrawString(rtb.Text, font1, Brushes.Black, 100, 100);//rtb.Text is a richtextbox object that i initialize in the beginning of the form
}
//this is the printbutton just a normal button
private void PrintButton_Click(object sender, EventArgs e)
{
printDialog1.ShowDialog();
printDocument1.Print();
}
如果您使用的是標準瀏覽器類型的對象應該有它自己的打印方法。 – Kell
如何爲一個支持多個Web瀏覽器實例的程序提供一個RichTextBox? RTB甚至與瀏覽器有什麼關係? –
我正在發送一個http請求並檢索數據爲html代碼,我沒有使用渲染或webbroswer工具,並且在每個新選項卡上都創建了富文本框 –