Bock Golf Lab 5
Bock Golf Lab 5
'DANIEL ANTWI
'30-08-2022
Option Strict On
Public Class Form1
End Sub
Catch ex As Exception
End Try
End Sub
'CREATING A FUNCTION TO CHECK FOR VALID DATA
Return Valid
End Function
'TO CLEAR THE FORM
SelectItemComboBox.SelectedIndex = -1
SelectItemComboBox.Items.Clear()
WholeSaleTextBox.Clear()
QuantityTextBox.Clear()
TotalInventoryTextBox.Clear()
InventoryItemListBox.Items.Clear()
TotalInventory = 0
SelectItemComboBox.Focus()
End If
End Sub
'COUNTING NUMBER OF ITEMS IN THE COMBOBOX
Private Sub CountItemListingToolStripMenuItem_Click(sender As Object, e As EventArgs)
Handles CountItemListingToolStripMenuItem.Click
Dim number As Integer = SelectItemComboBox.Items.Count()
MessageBox.Show("There are " & number & "items in the select item box.", "ITEM
COUNT", MessageBoxButtons.OK, MessageBoxIcon.Information)
End Sub
'ADDING AN ITEM TO THECOMBOBOX
Else
SelectItemComboBox.Items.Add(SelectItemComboBox.Text)
Exit For
End If
Next
Else
MessageBox.Show("Must enter a new item.", "INVALID ITEM NAME",
MessageBoxButtons.OK, MessageBoxIcon.Error)
End If
End Sub
'DELETE AN ITEM FROM THE COMBOBOX
End Class