Click here to Skip to main content
15,911,715 members
Home / Discussions / C#
   

C#

 
Questiondecimal format in xml serialization Pin
JoZ CaVaLLo30-Jun-08 22:08
JoZ CaVaLLo30-Jun-08 22:08 
QuestionChange windows Time & Date Pin
Mahdi 8216102130-Jun-08 21:59
Mahdi 8216102130-Jun-08 21:59 
AnswerRe: Change windows Time & Date Pin
Simon P Stevens30-Jun-08 22:34
Simon P Stevens30-Jun-08 22:34 
AnswerRe: Change windows Time & Date Pin
PIEBALDconsult1-Jul-08 4:56
mvePIEBALDconsult1-Jul-08 4:56 
Questionbinding data from sql tables to treeview control c#.net? Pin
Ashish Kumar Vyas30-Jun-08 21:57
Ashish Kumar Vyas30-Jun-08 21:57 
QuestionAdding rows to DataGridView programmatically Pin
Desmond Lim30-Jun-08 21:51
Desmond Lim30-Jun-08 21:51 
AnswerRe: Adding rows to DataGridView programmatically Pin
lnkgoeng2-Jul-08 0:55
lnkgoeng2-Jul-08 0:55 
QuestionProblem with printing a page foreach listview.items Pin
andredani30-Jun-08 21:48
andredani30-Jun-08 21:48 
Hi all!

I´m trying to make a barcodeprinting and to make it possible i have to have a page foreach items in my listview.

my code look like this:

private void button1_Click(object sender, EventArgs e)
{
if (checkBox1.Checked == true)
{
PrintDialog theDialog = new PrintDialog();
theDialog.Document = printDocument1;
if (theDialog.ShowDialog() == DialogResult.OK)
{
printDocument1.DocumentName = listView1.Items.Count.ToString();
printDocument1.PrintPage += new PrintPageEventHandler(this.printDocument1_PrintPage);
printDocument1.Print();
}
}
}

private void printDocument1_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e)
{
foreach (ListViewItem lvi in listView1.Items)
{
DateTime dt = DateTime.Now;
string doktyp = "278";
Font font = new Font("3 of 9 Barcode", 20);
int St = Convert.ToInt32(domainUpDown1.Text);
Font font1 = new Font("Arial", St);
Font font2 = new Font("Arial", 10);
float x = 120;
float y = 100;
e.Graphics.DrawString("Jobb: " + label11.Text, font2, new SolidBrush(Color.Black), x + 500, y - 50);
e.Graphics.DrawString("Användare: " + label12.Text, font2, new SolidBrush(Color.Black), x + 500, y - 35);
e.Graphics.DrawString(dt.ToString("yyyy-dd-MM HH:mm:ss"), font2, new SolidBrush(Color.Black), x + 500, y - 20);

e.Graphics.DrawString("*" + lvi.SubItems[1].Text + "*", font, new SolidBrush(Color.Black), x, y + 85);
e.Graphics.DrawString("*" + lvi.SubItems[1].Text + "*", font, new SolidBrush(Color.Black), x, y + 105);
e.Graphics.DrawString("*" + lvi.SubItems[1].Text + "*", font, new SolidBrush(Color.Black), x, y + 125);
e.Graphics.DrawString(lvi.SubItems[1].Text, font1, new SolidBrush(Color.Black), x, y + 145);
}
}

With this code it overwhrites all the items in one page.

Thanks!

Best Regards André
AnswerRe: Problem with printing a page foreach listview.items Pin
Christian Graus30-Jun-08 21:58
protectorChristian Graus30-Jun-08 21:58 
GeneralRe: Problem with printing a page foreach listview.items Pin
andredani30-Jun-08 23:07
andredani30-Jun-08 23:07 
Questionabout c#.net Pin
rupmax30-Jun-08 21:39
rupmax30-Jun-08 21:39 
AnswerRe: about c#.net Pin
Christian Graus30-Jun-08 21:55
protectorChristian Graus30-Jun-08 21:55 
QuestionLINQ Pin
arkiboys30-Jun-08 21:23
arkiboys30-Jun-08 21:23 
AnswerRe: LINQ Pin
Christian Graus30-Jun-08 21:57
protectorChristian Graus30-Jun-08 21:57 
AnswerRe: LINQ Pin
Scott Dorman30-Jun-08 22:57
professionalScott Dorman30-Jun-08 22:57 
Questionsimple test Pin
blackjack215030-Jun-08 21:02
blackjack215030-Jun-08 21:02 
AnswerRe: simple test Pin
Christian Graus30-Jun-08 21:56
protectorChristian Graus30-Jun-08 21:56 
AnswerRe: simple test Pin
Scott Dorman30-Jun-08 23:00
professionalScott Dorman30-Jun-08 23:00 
QuestionPropertyGrid Pin
KBou30-Jun-08 20:53
KBou30-Jun-08 20:53 
AnswerRe: PropertyGrid Pin
leppie30-Jun-08 20:55
leppie30-Jun-08 20:55 
QuestionRe: PropertyGrid [modified] Pin
KBou30-Jun-08 21:05
KBou30-Jun-08 21:05 
AnswerRe: PropertyGrid Pin
stancrm30-Jun-08 22:39
stancrm30-Jun-08 22:39 
QuestionRe: PropertyGrid Pin
KBou30-Jun-08 22:49
KBou30-Jun-08 22:49 
AnswerRe: PropertyGrid Pin
leppie1-Jul-08 1:08
leppie1-Jul-08 1:08 
GeneralRe: PropertyGrid Pin
KBou1-Jul-08 1:26
KBou1-Jul-08 1:26 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.