private void printDocument1_PrintPage(object sender,System.Drawing.Printing.PrintPageEventArgs e) { int height = 0; int width = 0; 钢笔=新笔(Brushes.Black,2.5f);
if (tabRemainder.SelectedTab == tabBank)
{
#region noBank
e.Graphics.FillRectangle(Brushes.DarkGray,new Rectangle(100,100,dataGridViewRemain.Columns[0].Width,dataGridViewRemain.Rows[0].Height));
e.Graphics.DrawRectangle(pen,new Rectangle(100,100,dataGridViewRemain.Columns[0].Width,dataGridViewRemain.Rows[0].Height));
e.Graphics.DrawString(dataGridViewRemain.Columns[0].HeaderText.ToString(),dataGridViewRemain.Font,Brushes.Black,new Rectangle(100,100,dataGridViewRemain.Columns[0].Width,dataGridViewRemain.Rows[0].Height));
#endregion
}
}
答案 0 :(得分:0)
如果没有完整的代码,我猜您似乎正在使用名称空间System.Drawing
和Microsoft.Office.Interop.Excel
。这引起了歧义。请将Rectangle
替换为完全限定名称System.Drawing.Rectangle
。