karim orooji
New member
- Joined
- Jul 15, 2014
- Messages
- 1
- Programming Experience
- Beginner
Hi to all friends
As is characteristic of the post I took the time to print a print queue for my display number plates
With this code, I've chosen to print submissions
After closing the program twice to open the correct information was displayed
As is characteristic of the post I took the time to print a print queue for my display number plates
With this code, I've chosen to print submissions
VB.NET:
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick Dim searchPrintJobs As ManagementObjectSearcher = New ManagementObjectSearcher("SELECT * FROM Win32_PrintJob")
Dim jobs As ManagementObjectCollection = searchPrintJobs.Get
For Each job As ManagementObject In jobs
Dim str_list(3) As String
str_list(3) = (job.Properties("Document").Value.ToString)
str_list(2) = (job.Properties("size").Value.ToString + "KB ")
str_list(1) = (job.Properties("TotalPages").Value.ToString)
str_list(0) = (ManagementDateTimeConverter.ToDateTime(job.Properties("TimeSubmitted").Value))
Dim itm As New ListViewItem(str_list)
ListView1.Items.Add(itm)
remove_empty_row()
Next
End Sub
Sub remove_empty_row()
Dim i As Integer = 0
While i < ListView1.Items.Count
If CStr(ListView1.Items.Item(i).Text) = "" Then
ListView1.Items.RemoveAt(i)
Else
i += 1
End If
End While
For Row As Int16 = 0 To ListView1.Items.Count - 2
For RowAgain As Int16 = ListView1.Items.Count - 1 To Row + 1 Step -1
If ListView1.Items(Row).ToString = ListView1.Items(RowAgain).ToString Then
ListView1.Items.RemoveAt(RowAgain)
End If
Next
Next
End Sub
Attachments
Last edited: