, Visual C#


- 4


if (OffOn == false)

{

// :

timer1.Enabled = false;

// OffOn :

OffOn = true;

}

else

{

// :

timer1.Enabled = true;

 

// OffOn :

OffOn = false;

}

}

 

60.6. PrintDocument.

private void printDocument1_PrintPage(object sender,

System.Drawing.Printing.PrintPageEventArgs e)

{

// myGraphics Graphics:

Graphics myGraphics = CreateGraphics();

// myGraphics :

myGraphics = e.Graphics;

// ,

// :

myGraphics.DrawLine(new Pen(Color.Red, 3),

boundary_of_rectangle_x, boundary_of_rectangle_,

width_of_rectangle, boundary_of_rectangle_);

myGraphics.DrawLine(new Pen(Color.Red, 3),

boundary_of_rectangle_x, boundary_of_rectangle_,

boundary_of_rectangle_x, height_of_rectangle);

myGraphics.DrawLine(new Pen(Color.Red, 3),

boundary_of_rectangle_x, height_of_rectangle,

width_of_rectangle, height_of_rectangle);

myGraphics.DrawLine(new Pen(Color.Red, 3),

width_of_rectangle, boundary_of_rectangle_,

width_of_rectangle, height_of_rectangle);

// ,

//:

Font drawFont = new Font("Times New Roman", 100,

FontStyle.Bold, GraphicsUnit.Point);

// , :

string drawText = "Visual";

//

// MeasureString:

SizeF SizeF_of_Text = new

SizeF(myGraphics.MeasureString(drawText, drawFont));