' this code for checkboxes = true if your checkboxes in listview = true For Each Itm As ListViewItem In ListView1.Items If Itm.Checked = True Then e.Graphics.DrawString(Itm.Text, New Drawing.Font("Time New Roman", 10), Brushes.Black, 50, H) e.Graphics.DrawString(Itm.SubItems(1).Text, New Drawing.Font("Time New Roman", 10), Brushes.Black, 200, H) e.Graphics.DrawString(Itm.SubItems(2).Text, New Drawing.Font("Time New Roman", 10), Brushes.Black, 350, H) H += 20 End If Next ' this code for selected listview item For Each Itm As ListViewItem In ListView1.Items If Itm.Selected = True Then e.Graphics.DrawString(Itm.Text, New Drawing.Font("Time New Roman", 10), Brushes.Black, 50, H) e.Graphics.DrawString(Itm.SubItems(1).Text, New Drawing.Font("Time New Roman", 10), Brushes.Black, 200, H) e.Graphics.DrawString(Itm.SubItems(2).Text, New Drawing.Font("Time New Roman", 10), Brushes.Black, 350, H) H += 20 End If Next sorry late response thank for visiting my channel
You can add new code .. Dim P_Preview as new PrintPreviewDialog P_Preview.Document = PrintDocument1 P_Preview.ShowDialog Fighting to modif your code ..
I have no words to describe how you helped me. Thanks a lot!
thank you thank you so much
thanks a lot bro
what if i want to print all items in listbox. please help me. it only print 2 columns. how to add another column. Thanks in advance
What if i want only to print selected item in list view?
' this code for checkboxes = true if your checkboxes in listview = true
For Each Itm As ListViewItem In ListView1.Items
If Itm.Checked = True Then
e.Graphics.DrawString(Itm.Text, New Drawing.Font("Time New Roman", 10), Brushes.Black, 50, H)
e.Graphics.DrawString(Itm.SubItems(1).Text, New Drawing.Font("Time New Roman", 10), Brushes.Black, 200, H)
e.Graphics.DrawString(Itm.SubItems(2).Text, New Drawing.Font("Time New Roman", 10), Brushes.Black, 350, H)
H += 20
End If
Next
' this code for selected listview item
For Each Itm As ListViewItem In ListView1.Items
If Itm.Selected = True Then
e.Graphics.DrawString(Itm.Text, New Drawing.Font("Time New Roman", 10), Brushes.Black, 50, H)
e.Graphics.DrawString(Itm.SubItems(1).Text, New Drawing.Font("Time New Roman", 10), Brushes.Black, 200, H)
e.Graphics.DrawString(Itm.SubItems(2).Text, New Drawing.Font("Time New Roman", 10), Brushes.Black, 350, H)
H += 20
End If
Next
sorry late response
thank for visiting my channel
thanks a lot :)
it prints because you set items that you want to print but how can i print user inputs using listview without setting the items you want to print?
that tutorial is just to print item in Listview ..you can replace the existing item in listview ..you can develop that code again ..
It prints but doesn't show the print preview like yours does.
Maybe u forget printdialog to show print preview ..
Try again and don't giveup ^^
It prints but it doesn't show the print preview.. please help
Checked preview before printing in your printer setting ..
tmbh lagi tutornya masbro
+zHeno Zero ok masbro ..ditunggu aja ..
It prints as a .pdf file. I don't have a printer. Please, help me to show the print preview first. Thank you very much!
You can add new code ..
Dim P_Preview as new PrintPreviewDialog
P_Preview.Document = PrintDocument1
P_Preview.ShowDialog
Fighting to modif your code ..