con un parametro entero tengo que imprimir lo siguiente
Suponiendo que el numeor es 12:
12 - 1
11 - 2
10 - 3
9 - 4
8 - 5
7 - 6
Como puedo hacerlo y mandarlo imprimir?
Gracias y se agradece el tiempo.
|
|
#1 (permalink) |
![]() Fecha de Ingreso: julio-2007
Mensajes: 412
|
Ayudita!!!
con un parametro entero tengo que imprimir lo siguiente Suponiendo que el numeor es 12: 12 - 1 11 - 2 10 - 3 9 - 4 8 - 5 7 - 6 Como puedo hacerlo y mandarlo imprimir? Gracias y se agradece el tiempo. |
|
|
|
|
|
#3 (permalink) |
![]() Fecha de Ingreso: septiembre-2007
Mensajes: 74
|
Re: Ayudita!!!
Bueno no te entendi bien pero a ver si esto te sirve
Código:
/*Agrega la siguiente referencia*/
using System.Drawing.Printing;
/*EL SIGUIENTE CODIGO TE PERMITE MANDAR A IMPRESORA TEXTO PLANO*/
#region "Impresion"
private Font printFont;
private string printString;
public void PrintAString(string data)
{
PrintDocument pd = new PrintDocument();
printFont = new Font("Courier", 10);
printString = data;
pd.PrintPage += new PrintPageEventHandler(PrintPage);
pd.Print();
}
private void PrintPage(object sender,PrintPageEventArgs e)
{
float xp = 10;
float yp = 20;
e.Graphics.DrawString(printString, printFont, Brushes.Black, xp, yp, new StringFormat());
}
#endregion
/*FUNCION QUE RECIBE EL NUMERO LO CALCULA Y LO MANDA A IMPRESORA*/
private void inversa(int int_numero)
{
string str_cadena=string.Empty;
for (int int_contador = 1; int_contador <= int_numero; int_contador++)
{
str_cadena += int_numero.ToString() + " - " + int_contador.ToString()+"\n";
int_numero--;
}
PrintAString(str_cadena);
}
|
|
|
|