Bonjour, je souhaiterais imprimer / mettre dans l'apercu un control ou au moin sa valeur.
J'ai trouvé ceci pour c#.net :
http://www.codyx.org/snippet_capture-image-form-tous-controles_147.aspx
Mais sa ne fonctionne pas :/
Voila mon code :
private void pd_PrintPage(object sender, PrintPageEventArgs e)
{
e.Graphics.DrawString("coucou, voili un ptit test", new Font(FontFamily.GenericSansSerif, 4), new SolidBrush(Color.Black), 25, 45);
Bitmap lbl = new Bitmap(Label1.Size.Width, base.Size.Height);
Label1.DrawToBitmap(lbl, new System.Drawing.Rectangle(0, 0, Label1.Size.Width, Label1.Size.Height));
}
Le "coucou voili un ptit test" s'affiche bien mais pas le label.
Si quelqu'un pouvias m'eclairer la dessus.
Merci.