private static void printDoc_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e)
{
int i;
int nWidth;
int nTop = e.MarginBounds.Top;
int nLeft = e.MarginBounds.Left;
DataRow prow = projectTable.Rows[0];
try
{
//if (PrintFont == null) PrintFont = dg.Font; // Before starting first page, it saves Width & Height of Headers and CoulmnType
if (PageNo == 1)
{
int cc = constructTable.Columns.Count - 1;
nWidth = (int)(Math.Floor((double)1 / (double)cc * (double)e.MarginBounds.Width));
nHeight = (int)(e.Graphics.MeasureString("项目名称", PrintFont, nWidth).Height) + 0;
for (int q = 0; q < cc; q++)
{
ColumnLefts.Add(nLeft);
ColumnWidths.Add(nWidth);
nLeft += nWidth;
}
求这行什么什么意思:nWidth = (int)(Math.Floor((double)1 / (double)cc * (double)e.MarginBounds.Width));
{
int i;
int nWidth;
int nTop = e.MarginBounds.Top;
int nLeft = e.MarginBounds.Left;
DataRow prow = projectTable.Rows[0];
try
{
//if (PrintFont == null) PrintFont = dg.Font; // Before starting first page, it saves Width & Height of Headers and CoulmnType
if (PageNo == 1)
{
int cc = constructTable.Columns.Count - 1;
nWidth = (int)(Math.Floor((double)1 / (double)cc * (double)e.MarginBounds.Width));
nHeight = (int)(e.Graphics.MeasureString("项目名称", PrintFont, nWidth).Height) + 0;
for (int q = 0; q < cc; q++)
{
ColumnLefts.Add(nLeft);
ColumnWidths.Add(nWidth);
nLeft += nWidth;
}
求这行什么什么意思:nWidth = (int)(Math.Floor((double)1 / (double)cc * (double)e.MarginBounds.Width));
有人知道是什么意思吗?谢谢