How to print data to next page in C# PrintDocument - c#

I have written this code to print a lab report. It works fine but when I click on the print button and if the data of the report is more than one page it doesn't create the next page. Now I want the multiple-page setting I am totally confused about how to do it.
private void printDocument1_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e)
{
int position = 60;
for (int j = NoOfItemsTill; j < types.Count; j++)
{
e.Graphics.DrawString(types[j], new Font("Arial", 16, FontStyle.Bold), Brushes.Black, new Point(30, yposition - 30 + position));
e.Graphics.DrawImage(imae, 33, yposition + position, imae.Width, imae.Height);
e.Graphics.DrawString("Test", new Font("Arial", 12, FontStyle.Bold), Brushes.Black, new Point(40, yposition + 5 + position));
e.Graphics.DrawString("Normal Value", new Font("Arial", 12, FontStyle.Bold), Brushes.Black, new Point(310, yposition + 5 + position));
e.Graphics.DrawString("Result ", new Font("Arial", 12, FontStyle.Bold), Brushes.Black, new Point(560, yposition + 5 + position));
if (checkBox1showprise.Checked == true)
{
e.Graphics.DrawString("Price ", new Font("Arial", 12, FontStyle.Bold), Brushes.Black, new Point(700, yposition + 5 + position));
}
for (int i = 0; i < dataGridView1.Rows.Count; i++)
{
if (dataGridView1.Rows[i].Cells[1].Value.ToString() == types[j])
{
e.Graphics.DrawString(dataGridView1.Rows[i].Cells[2].Value.ToString(), new Font("Arial", 12, FontStyle.Regular), Brushes.Black, new Point(30, yposition + 50 + position));
e.Graphics.DrawString(dataGridView1.Rows[i].Cells[3].Value.ToString(), new Font("Arial", 12, FontStyle.Regular), Brushes.Black, new Point(310, yposition + 50 + position));
e.Graphics.DrawString(dataGridView1.Rows[i].Cells[4].Value.ToString(), new Font("Arial", 12, FontStyle.Regular), Brushes.Black, new Point(560, yposition + 50 + position));
if (checkBox1showprise.Checked == true)
{
e.Graphics.DrawString(dataGridView1.Rows[i].Cells[5].Value.ToString(), new Font("Arial", 12, FontStyle.Regular), Brushes.Black, new Point(700, yposition + 50 + position));
}
position += 25;
}
}
yposition = yposition + 100;
}
// reset vaerables
// NoOfItemPerpage = 0;
NoOfItemsTill = 0;
}
I want that after every 5 elements of my array, the next page is created and the data is printed onto the next page.

Related

Why is my receipt not printing on my shop?

I have created a shop and it should print a receipt for the customer but when I go to print it says no pages found.
It should be working after I click the print button to print the page and show preview but its saying nothing to show.
Why is it not printing?
int shopitemid, shopquantity, shopprice, shoptotal, pos = 60;
string shopname;
private void printDocument1_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e)
{
e.Graphics.DrawString("The Androids Dungeon", new Font("Century Gothic", 12, FontStyle.Bold), Brushes.Red, new Point(80));
e.Graphics.DrawString("ID Product Price Quantity Total", new Font("Century Gothic", 10, FontStyle.Bold), Brushes.Red, new Point(26,40));
foreach(DataGridViewRow row in datafrmcheckout.Rows)
{
shopitemid = Convert.ToInt32(row.Cells["Column1"].Value);
shopname = "" + row.Cells["Column2"].Value;
shopprice = Convert.ToInt32(row.Cells["Column3"].Value);
shopquantity = Convert.ToInt32(row.Cells["Column4"].Value);
shoptotal = Convert.ToInt32(row.Cells["Column5"].Value);
e.Graphics.DrawString("" + shopitemid, new Font("Century Gothic", 8, FontStyle.Bold), Brushes.Blue, new Point(26, pos));
e.Graphics.DrawString("" + shopname, new Font("Century Gothic", 8, FontStyle.Bold), Brushes.Blue, new Point(45, pos));
e.Graphics.DrawString("" + shopprice, new Font("Century Gothic", 8, FontStyle.Bold), Brushes.Blue, new Point(120, pos));
e.Graphics.DrawString("" + shopquantity, new Font("Century Gothic", 8, FontStyle.Bold), Brushes.Blue, new Point(170, pos));
e.Graphics.DrawString("" + shoptotal, new Font("Century Gothic", 8, FontStyle.Bold), Brushes.Blue, new Point(235, pos));
pos = pos + 20;
}
e.Graphics.DrawString("Grand Total: £ " +grdtotal , new Font("Century Gothic", 12, FontStyle.Bold), Brushes.Crimson, new Point(60, pos + 50));
e.Graphics.DrawString("***The Android Dungeon***", new Font("Century Gothic", 12, FontStyle.Bold), Brushes.Crimson, new Point(40, pos + 85));
datafrmcheckout.Rows.Clear();
datafrmcheckout.Refresh();
pos = 100;
grdtotal = 0;
}
private void Printbt_Click(object sender, EventArgs e)
{
printDocument1.DefaultPageSettings.PaperSize = new System.Drawing.Printing.PaperSize("pprnm", 285, 600);
if(printPreviewDialog1.ShowDialog() == DialogResult.OK)
{
printDocument1.Print();
}
}

c# Drawing lines between 2 buttons

I hope you can help me and this is a big code, so I'll try to explain it short. I'm making a program that can place logic gates and that can connect to each other, I'm using the OnPaint(PaintEventArgs e) method and I have troubles with connecting gates with a line. (the code is also really chaotic)
I add my gates in a List
private List<Tuple<Point, int>> droppedShapes = new List<Tuple<Point, int>>();
And my lines in
private List<Tuple<Point, Point>> allLines = new List<Tuple<Point, Point>>();
So I can save the x-y coordinates.
I use buttons to connect my lines, so on each end of connection I got a button that I can click. But I can only connect the 2 inputs of one component to each other.
Here is my code, I hope you can help me!
Here you can see how I draw my components and buttons.
protected override void OnPaint(PaintEventArgs e)
{
base.OnPaint(e);
screen.Clear(Color.Black);
Pen whitePen = new Pen(Color.White);
SolidBrush tealBrush = new SolidBrush(Color.Teal);
SolidBrush whiteBrush = new SolidBrush(Color.White);
SolidBrush yellowBrush = new SolidBrush(Color.Yellow);
SolidBrush grayBrush = new SolidBrush(Color.Gray);
SolidBrush redBrush = new SolidBrush(Color.Red);
foreach (var line in allLines)
{
screen.DrawLine(whitePen, line.Item1, line.Item2);
}
foreach (var pair in this.droppedShapes)
{
var shapeType = pair.Item2; // Reveal your own shape object here
var location = pair.Item1;
switch (shapeType) // Reveal your own shape object here
{
case 0:
screen.DrawRectangle(whitePen, location.X - 10, location.Y - 10, 20, 20);
screen.DrawString("&", new Font(FontFamily.GenericMonospace, (float)18), whiteBrush, location.X - 11, location.Y - 13);
screen.DrawLine(whitePen, location.X - 20, location.Y + 6, location.X - 10, location.Y + 6);
screen.DrawLine(whitePen, location.X - 20, location.Y - 6, location.X - 10, location.Y - 6);
screen.DrawLine(whitePen, location.X + 20, location.Y, location.X + 10, location.Y);
newB = new Point(location.X - 25, location.Y + 2);
newB2 = new Point(location.X - 25, location.Y - 10);
newB3 = new Point(location.X + 20, location.Y - 3);
button1 = new Button();
button2 = new Button();
button3 = new Button();
button1.Size = new Size(8, 8);
button2.Size = new Size(8, 8);
button3.Size = new Size(8, 8);
newB.Offset(0, 0);
newB2.Offset(0, 0);
newB3.Offset(0, 0);
button1.Location = newB;
button2.Location = newB2;
button3.Location = newB3;
button1.Click += Button_Click1;
button2.Click += Button_Click2;
button3.Click += Button_Click3;
drawPanel.Controls.Add(button1);
drawPanel.Controls.Add(button2);
drawPanel.Controls.Add(button3);
if (jaOfNee == true)
{
screen.DrawString(pair.Item1.ToString(), new Font(FontFamily.GenericMonospace, (float) 6), whiteBrush, location.X - 25, location.Y - 25);
}
break;
case 1:
screen.DrawRectangle(whitePen, location.X - 10, location.Y - 10, 20, 20);
screen.DrawString("1", new Font(FontFamily.GenericMonospace, (float)10), whiteBrush, location.X, location.Y - 9);
screen.DrawString(">", new Font(FontFamily.GenericMonospace, (float)8), whiteBrush, location.X - 8, location.Y - 10);
screen.DrawLine(whitePen, location.X + 1, location.Y + 1, location.X - 5, location.Y + 1);
screen.DrawLine(whitePen, location.X - 20, location.Y + 6, location.X - 10, location.Y + 6);
screen.DrawLine(whitePen, location.X - 20, location.Y - 6, location.X - 10, location.Y - 6);
screen.DrawLine(whitePen, location.X + 20, location.Y, location.X + 10, location.Y);
newB = new Point(location.X - 25, location.Y + 2);
newB2 = new Point(location.X - 25, location.Y - 10);
newB3 = new Point(location.X + 20, location.Y - 3);
button1 = new Button();
button2 = new Button();
button3 = new Button();
button1.Size = new Size(8, 8);
button2.Size = new Size(8, 8);
button3.Size = new Size(8, 8);
newB.Offset(0, 0);
newB2.Offset(0, 0);
newB3.Offset(0, 0);
button1.Location = newB;
button2.Location = newB2;
button3.Location = newB3;
button1.Click += Button_Click1;
button2.Click += Button_Click2;
button3.Click += Button_Click3;
drawPanel.Controls.Add(button1);
drawPanel.Controls.Add(button2);
drawPanel.Controls.Add(button3);
if (jaOfNee == true)
{
screen.DrawString(pair.Item1.ToString(), new Font(FontFamily.GenericMonospace, (float) 6), whiteBrush, location.X - 25, location.Y - 25);
}
break;
default:
break;
}
}
for (int i = drawPanel.Left - 5; i < drawPanel.Right + 10; i += 5)
{
for (int j = drawPanel.Top - 50; j < drawPanel.Bottom - 5; j += 5)
{
screen.FillEllipse(redBrush, i, j, 2, 2); //fills screen with a grid
}
}
// base.OnPaint(e);
// draw current location
if (currentLocation != null)
{
Point p = currentLocation.Value;
screen.FillEllipse(tealBrush, p.X + 1, p.Y, -4, -4);
}
drawPanel.CreateGraphics().DrawImage(backBuffer, 0, 0); //allows you to draw
}
}
(This is how I try to connect my 2 buttons)
foreach (var line in allLines)
{
screen.DrawLine(whitePen, line.Item1, line.Item2);
}
I don't use button 3 yet because I want to connect my inputs first so don't mind button 3.
This is how I try to save my X-Y coordinates.
private Point point1;
private Point point2;
private void Button_Click1(object sender, EventArgs e)
{
Console.WriteLine("button1");
point1 = button1.Location;
}
private void Button_Click2(object sender, EventArgs e)
{
Console.WriteLine("button2");
point2 = button2.Location;
}
private void Button_Click3(object sender, EventArgs e)
{
Console.WriteLine("button3");
}
private void DrawLine_Click(object sender, EventArgs e)
{
allLines.Add(new Tuple<Point, Point>(point1, point2));
}
After I press the button DrawLine it adds the location to the list.
Sorry for the horrible code.
I hope you understand my question a little bit more, it's really hard to explain my problem.

Printing a Multi-page Listview

Ok, I have got a printDocument1_PrintPage method which is supposed to print out the contents of a ListView. During execution, the method only prints out the first page. Could someone help me to printout the remaining page(s)?
I have identified the end of the first page via the variable ypos and set the property e.HasMorePages = true.
private void printDocument1_PrintPage(object sender, PrintPageEventArgs e){
Graphics graphics = e.Graphics;
int ypos = 78;
Font f1 = new Font("Arial", 14, FontStyle.Bold, GraphicsUnit.Pixel);
Brush brush = new SolidBrush(Color.LightSlateGray);
graphics.FillRectangle(brush, new Rectangle(10, 10, 770, 50));
Pen blackpen = new Pen(Color.Black);
Pen graypen = new Pen(Color.LightGray);
Pen redpen = new Pen(Color.Red);
graphics.DrawRectangle(blackpen, new Rectangle(10, 10, 770, 50));
Brush B = new SolidBrush(listView1.ForeColor);
graphics.DrawLine(blackpen, 10, 10, 10, 1132);
graphics.DrawString("FORENAME", f1, Brushes.Black, new Point(20, 25));
graphics.DrawLine(blackpen, 130, 10, 130, 1132);
graphics.DrawString("SURNAME", f1, Brushes.Black, new Point(140, 25));
graphics.DrawLine(blackpen, 290, 10, 290, 1132);
graphics.DrawString("EXT.", f1, Brushes.Black, new Point(300, 25));
graphics.DrawLine(blackpen, 380, 10, 380, 1132);
graphics.DrawString("JOB TITLE", f1, Brushes.Black, new Point(410, 25));
graphics.DrawLine(blackpen, 780, 10, 780, 1132);
int[] X = { 15, 140, 300, 390, 720 };
int Y = 60;
f1 = listView1.Font;
for (int I = 0; I < listView1.Items.Count; I++){
for (int J = 0; J < listView1.Items[I].SubItems.Count - 1; J++){
graphics.DrawString(listView1.Items[I].SubItems[J].Text, f1, B, X[J], Y);
}
Y += f1.Height;
graphics.DrawLine(graypen, 10, ypos, 780, ypos);
ypos = ypos + 17;
if (ypos > 1132){
e.HasMorePages = true;
return;
}
}
graphics.Dispose();
}

Not printing the data from DataGridView but shown in PrintPreview

In the below code in print preview it is showing all the data from DataGridView but not printing the all the data just printing the structure of page
I have attached image of both print preview and the printout
private void btnPrintPreview_Click(object sender, EventArgs e)
{
printPreviewDialog1.ShowDialog();
i = 0;
}
private void printDocument1_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e)
{
e.Graphics.DrawString("Purchase Order ", new Font("Arial", 28, FontStyle.Bold), Brushes.Black, new Point(280, 10));
e.Graphics.DrawString("POPULAR ", new Font("Arial", 20, FontStyle.Bold), Brushes.Black, new Point(10, 50));
e.Graphics.DrawString("Center", new Font("Arial", 14, FontStyle.Regular), Brushes.Black, new Point(20, 80));
e.Graphics.DrawString("Behind ,", new Font("Arial", 11, FontStyle.Regular), Brushes.Black, new Point(10, 100));
e.Graphics.DrawString(" Colony,", new Font("Arial", 11, FontStyle.Regular), Brushes.Black, new Point(10, 120));
e.Graphics.DrawString("Sh - 501.", new Font("Arial", 11, FontStyle.Regular), Brushes.Black, new Point(10, 140));
e.Graphics.DrawString("TIN : " + DateTime.Now.ToShortDateString(), new Font("Arial", 11, FontStyle.Regular), Brushes.Black, new Point(10, 160));
e.Graphics.DrawString("GST : " + DateTime.Now.ToShortDateString(), new Font("Arial", 11, FontStyle.Regular), Brushes.Black, new Point(10, 178));
e.Graphics.DrawString("P O No. : " + lblPONumber.Text.Trim(), new Font("Arial", 12, FontStyle.Regular), Brushes.Black, new Point(10, 197));
e.Graphics.DrawString("Date : " + date.Text, new Font("Arial", 12, FontStyle.Regular), Brushes.Black, new Point(506, 197));
e.Graphics.DrawString("Customer Name : " + txtSupplierName.Text.Trim(), new Font("Arial", 12, FontStyle.Regular), Brushes.Black, new Point(420, 70));
e.Graphics.DrawString("Company Name : " + txtSupplierCompanyName.Text.Trim(), new Font("Arial", 12, FontStyle.Regular), Brushes.Black, new Point(420, 90));
e.Graphics.DrawString("Mobile No. : " + txtMobile.Text.Trim(), new Font("Arial", 12, FontStyle.Regular), Brushes.Black, new Point(420, 110));
e.Graphics.DrawString("Address : ", new Font("Arial", 12, FontStyle.Regular), Brushes.Black, new Point(420, 130));
e.Graphics.DrawString(" ", new Font("Arial", 12, FontStyle.Regular), Brushes.Black, new Point(420, 150));
e.Graphics.DrawString("City : ", new Font("Arial", 12, FontStyle.Regular), Brushes.Black, new Point(420, 170));
e.Graphics.DrawString("------------------------------------------------------------------------------------------------------------------------------------", new Font("Arial", 12, FontStyle.Regular), Brushes.Black, new Point(10, 210));
e.Graphics.DrawString("Sl No.", new Font("Arial", 10, FontStyle.Regular), Brushes.Black, new Point(05, 227));
e.Graphics.DrawString("Item Name", new Font("Arial", 12, FontStyle.Regular), Brushes.Black, new Point(55, 225));
e.Graphics.DrawString("Quantity", new Font("Arial", 12, FontStyle.Regular), Brushes.Black, new Point(380, 225));
e.Graphics.DrawString("Unit Price", new Font("Arial", 12, FontStyle.Regular), Brushes.Black, new Point(510, 225));
e.Graphics.DrawString("Total", new Font("Arial", 12, FontStyle.Regular), Brushes.Black, new Point(660, 225));
e.Graphics.DrawString("------------------------------------------------------------------------------------------------------------------------------------", new Font("Arial", 12, FontStyle.Regular), Brushes.Black, new Point(10, 235));
int ypos = 250;
while (i < dataGridView1.Rows.Count)
{
if (ypos > e.MarginBounds.Height)
{
ypos = 250;
e.HasMorePages = true;
return;
}
numberofitemsprinted++;
SlNumber++;
e.Graphics.DrawString(SlNumber.ToString(), new Font("Arial", 12, FontStyle.Regular), Brushes.Black, new Point(10, ypos));
e.Graphics.DrawString(dataGridView1.Rows[i].Cells[0].FormattedValue.ToString(), new Font("Arial", 12, FontStyle.Regular), Brushes.Black, new Point(60, ypos));
e.Graphics.DrawString(dataGridView1.Rows[i].Cells[3].FormattedValue.ToString(), new Font("Arial", 12, FontStyle.Regular), Brushes.Black, new Point(397, ypos));
e.Graphics.DrawString(dataGridView1.Rows[i].Cells[2].FormattedValue.ToString(), new Font("Arial", 12, FontStyle.Regular), Brushes.Black, new Point(530, ypos));
e.Graphics.DrawString(dataGridView1.Rows[i].Cells[4].FormattedValue.ToString(), new Font("Arial", 12, FontStyle.Regular), Brushes.Black, new Point(670, ypos));
i++;
ypos = ypos + 30;
}
e.Graphics.DrawString("------------------------------------------------------------------------------------------------------------------------------------", new Font("Arial", 12, FontStyle.Regular), Brushes.Black, new Point(10, ypos));
e.Graphics.DrawString("Total Amount : " + txtTotalSum.Text.Trim(), new Font("Arial", 12, FontStyle.Regular), Brushes.Black, new Point(510, ypos + 30));
e.Graphics.DrawString("Amount in Words : " + txtTotalSumWords.Text.Trim(), new Font("Arial", 12, FontStyle.Regular), Brushes.Black, new Point(200, ypos + 120));
numberofitemsperpage = 0;
numberofitemsprinted = 0;
SlNumber = 0;
}
private void btnPrint_Click(object sender, EventArgs e)
{
printDocument1.Print();
}
You need to reset the variable i before the printing.
It looks as if the PrintPage is called once for the preview and then, without i being reset, again for the actual printing..
This should help:
private void btnPrint_Click(object sender, EventArgs e)
{
i = 0;
printDocument1.Print();
}
I would also strongly suggest to change the name i to something more explicit like currentPrintRow..

Print data grid view data in two printer?

I want to print some data in printer 1 and some data in printer 2.
public void printkot()
{
PrintDialog pd = new PrintDialog();
PrintDocument pdoc = new PrintDocument();
PrinterSettings ps = new PrinterSettings();
Font font = new Font("Arial", 12);
PaperSize psize = new PaperSize("Custome", 314, 500);
pd.Document = pdoc;
for (int ch = 0; dataGridView1.Rows.Count > ch; ch++)
{
if (dataGridView1.Rows[ch].Cells["calkot_print"].Value.ToString() == "K1")
{
pdoc.PrinterSettings.PrinterName = "KOT";
pdoc.PrintPage += new PrintPageEventHandler(printDocument1_PrintPage);
}
}
pd.Document.DefaultPageSettings.PaperSize = psize;
pdoc.DefaultPageSettings.PaperSize.Height = 500;
pdoc.DefaultPageSettings.PaperSize.Width = 314;
if (pdoc.PrinterSettings.IsValid)
{
pdoc.Print();
}
else
{
MessageBox.Show("Printer is invalid.");
}
}
private void printDocument1_PrintPage2(object sender, PrintPageEventArgs e)
{
string table_no;
table_no = lbltable.Text;
float xs = 10;
float ys = 5;
float widths = 285.0F; // max width I found through trial and error
float heights = 0F;
DataTable dtm = blu.checkbusiness();
Font drawFontArial12Bold = new Font("Arial", 12, FontStyle.Bold);
Font drawFontArial10Regular = new Font("Arial", 9, FontStyle.Regular);
Font drawFontArial10Regularsmall = new Font("Arial", 6, FontStyle.Regular);
SolidBrush drawBrush = new SolidBrush(Color.Black);
Pen drawingPen = new Pen(Color.Black, 1);
// Set format of string.
StringFormat drawFormatCenter = new StringFormat();
drawFormatCenter.Alignment = StringAlignment.Center;
StringFormat drawFormatLeft = new StringFormat();
drawFormatLeft.Alignment = StringAlignment.Near;
StringFormat drawFormatRight = new StringFormat();
drawFormatRight.Alignment = StringAlignment.Far;
StringFormat drawFormatRightlest = new StringFormat();
string business_name = dtm.Rows[0]["business_name"].ToString();
string address = dtm.Rows[0]["address"].ToString();
Graphics gra = e.Graphics;
String strDate = DateTime.Now.ToLongTimeString();
gra.DrawString(strDate, new System.Drawing.Font("Arial", 7, FontStyle.Regular), new SolidBrush(System.Drawing.Color.Black), 10, 60);
e.Graphics.DrawString(business_name, drawFontArial12Bold, drawBrush, new RectangleF(xs, ys, widths, heights), drawFormatCenter);
ys += e.Graphics.MeasureString(business_name, drawFontArial12Bold).Height;
e.Graphics.DrawString(address, drawFontArial10Regular, drawBrush, new RectangleF(xs, ys, widths, heights), drawFormatCenter);
ys += e.Graphics.MeasureString(address, drawFontArial10Regular).Height;
gra.DrawString("Table No::", new System.Drawing.Font("Arial", 9, FontStyle.Regular), new SolidBrush(System.Drawing.Color.Black), 190, 60);
gra.DrawString(table_no, new System.Drawing.Font("Arial", 9, FontStyle.Regular), new SolidBrush(System.Drawing.Color.Black), 250, 45);
gra.DrawLine(drawingPen, 10, 75, 309, 75);
gra.DrawString("Item", new System.Drawing.Font("Arial", 9, FontStyle.Bold), new SolidBrush(System.Drawing.Color.Black), 30, 75);
gra.DrawString("Qty", new System.Drawing.Font("Arial", 9, FontStyle.Bold), new SolidBrush(System.Drawing.Color.Black), 220, 75);
gra.DrawLine(drawingPen, 10, 90, 309, 90);
int y;
y = 95;
for (int i = 0; i < dataGridView1.Rows.Count; i++)
{
string item_name = dataGridView1.Rows[i].Cells["cal_item_name"].Value.ToString();
string quantity = dataGridView1.Rows[i].Cells["cal_qty"].Value.ToString();
if (dataGridView1.Rows[i].Cells["calkot_print"].Value.ToString() == "K2")
{
gra.DrawString(item_name.ToString(), new System.Drawing.Font("Time New Roamn", 9, FontStyle.Regular), new SolidBrush(System.Drawing.Color.Black), 30, y);
gra.DrawString(quantity, new System.Drawing.Font("Time New Roamn", 9, FontStyle.Regular), new SolidBrush(System.Drawing.Color.Black), 220, y);
y = y + 15;
}
}
int z = y + 20;
gra.DrawLine(drawingPen, 10, z, 309, z);
gra.DrawString("Description", new System.Drawing.Font("Time New Roamn", 9, FontStyle.Bold), new SolidBrush(System.Drawing.Color.Black), 10, z + 5);
gra.DrawString(txtrichbox.Text, new System.Drawing.Font("Time New Roamn", 7, FontStyle.Regular), new SolidBrush(System.Drawing.Color.Black), 10, z + 20);
z = y + 20;
}

Categories