Parameters of the Abels in Printpage

Asked

Viewed 30 times

0

What parameters are possible to define the printing of Abels: The code I’m using is as follows::

e.Graphics.DrawString(label_nota_entrega.Text, new Font("Arial", 14, FontStyle.Bold), Brushes.Black, new PointF(550, 50));

It is possible to put a background color on the label?

2 answers

1

If I’m not mistaken, you just have to do something like this:

e.Graphics.DrawString(label_nota_entrega.Text, label_nota_entrega.BackColor = Color.Red, new Font("Arial", 14, FontStyle.Bold), Brushes.Black, new PointF(550, 50));

0


You can use LabelTeste.BackColor = Color.DarkRed; or even if you prefer to follow the line to draw everything on the screen. You can use next to the Drawstring the Drawrectangle and the Fillrectangle.

int LarguraRetangulo = 150;
int AlturaRetangulo = 20;

e.Graphics.DrawRectangle(new Pen(Color.LightGray), 0, 0, LarguraRetangulo, AlturaRetangulo);
e.Graphics.FillRectangle(Brushes.Orange, 0, 0, LarguraRetangulo, AlturaRetangulo);

e.Graphics.DrawString(label_nota_entrega.Text, new Font("Arial", 14, FontStyle.Bold), Brushes.Black, new PointF(0, 0));

Browser other questions tagged

You are not signed in. Login or sign up in order to post.