Advertisement
Guest User

Untitled

a guest
Mar 30th, 2017
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.70 KB | None | 0 0
  1. i = ListView1.Items.Add(txtOwner.Text)
  2. i.SubItems.Add(txtConcernID.Text)
  3. i.SubItems.Add(txtPartNumber.Text)
  4. i.SubItems.Add(txtDefect.Text)
  5. i.SubItems.Add(txtQTY.Text)
  6. i.SubItems.Add(txtDaysInSort.Text)
  7.  
  8. varDaysInSort = txtDaysInSort.Text
  9.  
  10. ChangeTheColor.Start()
  11. ColorChange()
  12.  
  13. Else
  14. MessageBox.Show("Please fill out all information boxes.")
  15. txtOwner.Text = ""
  16. txtConcernID.Text = ""
  17. txtPartNumber.Text = ""
  18. txtDefect.Text = ""
  19. txtQTY.Text = ""
  20. txtDaysInSort.Text = ""
  21. End If
  22. Catch ex As Exception
  23. MessageBox.Show("Please insert an integer into 'Days In Sort'.")
  24. txtOwner.Text = ""
  25. txtConcernID.Text = ""
  26. txtPartNumber.Text = ""
  27. txtDefect.Text = ""
  28. txtQTY.Text = ""
  29. txtDaysInSort.Text = ""
  30. End Try
  31.  
  32. If ListView1.Items.Count = 0 Then
  33. Dim counter As Integer
  34. counter = ListView1.Items.Count
  35. lblConcernTotal.Text = counter
  36. ElseIf ListView1.Items.Count > 0 Then
  37. Dim counter As Integer
  38. counter = ListView1.Items.Count
  39. lblConcernTotal.Text = counter
  40. Else
  41. lblConcernTotal.Text = "0"
  42. End If
  43.  
  44. lblConcernTotal.Text = ListView1.Items.Count
  45. End Sub
  46.  
  47. 'This sub makes a clone of listview1 item and sends to listview2
  48. 'THIS IS WHERE I NEED TO TAKE INFO FROM A TEXTBOX FROM ANOTHER
  49. 'FORM AND SPLICE IT TO THE END OF THE LISTVIEW1 ITEM.
  50. 'THE TEXTBOX IS CALLED "txtRejectQTY" AND THE FORM IS CALLED
  51. 'RejectForm
  52. Private Sub AddItemToSecondList(ByVal item As ListViewItem)
  53. Me.ListView2.Items.Add(item.Clone())
  54. End Sub
  55.  
  56.  
  57. Private Sub ListView1_MouseDoubleClick(sender As Object, e As System.Windows.Forms.MouseEventArgs) Handles ListView1.MouseDoubleClick
  58. '~> Use the HitTest method to grab a reference to the item which was
  59. ' double-clicked. Note that if the user double-clicks in an empty
  60. ' area of the list, the HitTestInfo.Item will be Nothing (which is what
  61. ' what we would want to happen):
  62. Dim info As ListViewHitTestInfo = Me.ListView1.HitTest(e.X, e.Y)
  63.  
  64. 'Get a reference to the item:
  65. Dim item As ListViewItem = info.Item
  66.  
  67. 'Ask user for quantity of rejected glass
  68. RejectFormAppears()
  69. 'Add Reject value just entered to the end of the listviewbox
  70. Dim reject As String = RejectForm.txtRejectQTY.Text
  71.  
  72. ' Make sure an item was the trget of the double-click:
  73. If Not item Is Nothing Then
  74. Me.AddItemToSecondList(item)
  75. End If
  76.  
  77. RemoveItemFromFirstList(item)
  78.  
  79. lblTotalDispositions.Text = ListView2.Items.Count
  80. lblConcernTotal.Text = ListView1.Items.Count
  81.  
  82. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement